GeoServer

Show a list of fonts available to the java runtime in a GUI page

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major 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

Activity

Hide
David Winslow added a comment -

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.

Show
David Winslow added a comment - 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.
Hide
Miles Jordan added a comment -

Is this still happening? I'm happy to do it if not

Show
Miles Jordan added a comment - Is this still happening? I'm happy to do it if not
Hide
Andrea Aime added a comment -

Nobody is working on it as far as I know, so please, go ahead

Show
Andrea Aime added a comment - Nobody is working on it as far as I know, so please, go ahead
Hide
Miles Jordan added a comment -

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?

Show
Miles Jordan added a comment - 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?
Hide
David Winslow added a comment -

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.

Show
David Winslow added a comment - 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.
Hide
David Winslow added a comment -

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.

Show
David Winslow added a comment - 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.
Hide
Andrea Aime added a comment -

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

Show
Andrea Aime added a comment - 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
Hide
Miles Jordan added a comment -

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).

Show
Miles Jordan added a comment - 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).
Hide
Andrea Aime added a comment -

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

Show
Andrea Aime added a comment - 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
Hide
Miles Jordan added a comment -

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?

Show
Miles Jordan added a comment - 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?
Hide
Miles Jordan added a comment -

Any more work to do on this?

Show
Miles Jordan added a comment - Any more work to do on this?
Hide
Andrea Aime added a comment -

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?

Show
Andrea Aime added a comment - 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?
Hide
Andrea Aime added a comment -

Changes committed on trunk at revision 14816

Show
Andrea Aime added a comment - Changes committed on trunk at revision 14816
Hide
Miles Jordan added a comment -

Yes, absolutely fine by me. They all look like logical changes. Thanks for taking the time to go through it.

Show
Miles Jordan added a comment - Yes, absolutely fine by me. They all look like logical changes. Thanks for taking the time to go through it.
Hide
Andrea Aime added a comment -

Mass closing all issues that have been in the resolved state for the last month without anyone commenting or reopening them

Show
Andrea Aime added a comment - Mass closing all issues that have been in the resolved state for the last month without anyone commenting or reopening them

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: