Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.1-beta2
-
Component/s: None
-
Labels:None
-
Number of attachments :4
Description
This should help a lot on Linux/Unix servers where the set of fonts available to the JVM is always a bit of a mystery
Attachments
-
- fonts.diff
- 07/Sep/10 11:49 PM
- 13 kB
- Miles Jordan
-
$i18n.getText("admin.common.words.hide")
- java-charmap.zip
- 01/Sep/10 8:21 AM
- 899 kB
- Andrea Aime
-
- CharMap4.pdf 80 kB
- RunJavaPrograms.pdf 87 kB
- CharMap4.class 37 kB
- CharMap4Grid.class 9 kB
- CharMap4J14.class 37 kB
- CharMap4J14Grid.class 9 kB
- CharMap4J14User.class 0.7 kB
- CharMap4User.class 0.7 kB
- CharMap4.java 119 kB
- CharMap4J14.java 120 kB
- CharMapParse1.java 4 kB
- CharMapParse5.java 19 kB
- CharMap4.txt 2.26 MB
- GnuPublicLicense3.txt 35 kB
- CharMap4.doc 43 kB
- CharMap4.ico 14 kB
-
- CharMap4.gif
- 18 kB
- 01/Sep/10 8:21 AM
-
- Clipboard01.jpg
- 129 kB
- 07/Sep/10 11:49 PM
Activity
I don't know what's happening to the screenshot I'm trying to upload.. its just disappearing.
Anyway. I just wrote code for it and put it in the status page with the other JVM stuff, but it looks rubbish if you have a lot of fonts. So it needs its own page. Where should it be linked from?
I used to have a patch for this, but I lost it (was going to go over it with Ivan as mentioned above, but never found the time...). In that patch I added a link from the server status page to a full fonts listing. I think this is still the way to go since most systems will have quite a few fonts installed.
A nice enhancement would be to have a preview map with the fonts used to label some dummy data, showing labels in various angles and curves. I'd be up for working on something like that once the basic font listing is in.
And if you really really have a boring day displaying a charmap like the attached program (under GPL v3) would at the same time fill the page, show the chars, and make it useful for dynamic symbolizer tff://<fontname>#<code> usage
How about this (new screenshot attached) for now? It uses wicket's BufferedDynamicImageResource to render the font to an image.
It's all on one page though - I tried putting it in a GeoserverTablePanel but wicket won't have the image go into the <span wicket:id="component"> tag (it must go into an <img> tag).
Looks good!
For the table you can create a fragment contaning an image, that's what we do to embed non label components in a table
Here it is. The diff contains new files - will subversion add them? If not I will post the .java files too. I can't commit so Andrea if you're happy could you please do it?
Hi Miles. Took the patch and gave it a ride.
Looks good, I only had to make a few minor adjustment, and make an API change to make the table search times bearable:
- the code was using a java 6 only api, new Font(font), I changed it so that it's no more necessary
- the buffered image used for the preview is not created on demand, making the page show up much faster
- the method to draw that image has been modified a bit to follow the actual method used by the WMS
- the property api now has a isSearchable() flag, this is up for all properties but the preview image, this
makes sure we don't try to search over the buffered images, which would imply generating them all just to
extract a toString of them - made PreviewFont serializable and the preview transient, so that we don't end up storing a ton of buffered
images in the session - the link from the status page is now more visible
Seems like many changes but in fact code wise they are not so many, the set of classes and so on has been maintained
and you probably have to look in detail to find the bits I've modified.
Since I've made an API change I'd like to commit this only on trunk, for the next 2.1 beta. Would that work for you?
- the code was using a java 6 only api, new Font(font), I changed it so that it's no more necessary
- the buffered image used for the preview is not created on demand, making the page show up much faster
- the method to draw that image has been modified a bit to follow the actual method used by the WMS
- the property api now has a isSearchable() flag, this is up for all properties but the preview image, this makes sure we don't try to search over the buffered images, which would imply generating them all just to extract a toString of them
- made PreviewFont serializable and the preview transient, so that we don't end up storing a ton of buffered images in the session
- the link from the status page is now more visible
Yes, absolutely fine by me. They all look like logical changes. Thanks for taking the time to go through it.
Mass closing all issues that have been in the resolved state for the last month without anyone commenting or reopening them
Ivan (from OpenGeo) has been asking me about how to write Wicket pages in GeoServer, so I'm going to take this task as a bit of a tutorial for him.