Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1 Font class need supportsGlyph() function

closed
Victor Mote
5
2006-04-28
2006-04-27
Max Berger
No

Dear axsl developers,

in the
src/java/org/axsl/font/Font.java

a new method should be added to provide information if a certain font
contains a particular glyph or not:

/**
* Checks if the font supports this glyph.
* @param codePoint The Unicode character to be checked.
* @return true if the glyph is supported.
*/
public bool hasGlyph(int codePoint);

Rationale: Automatic font-switching may need to occur for some
special characters. But it can only occur if we can find out what glyphs
are supported.

Other possible functions, based on that:
in Font:
/** Checks if all characters can be rendered */
public bool hasGlyphs(String s);

in FontServer:
/** List all fonts containing a glyph */
public Font[] getAllFontsWithGlyph(int codePoint,boolean
freeStandingFonts, boolean systemFonts);

/** Gets all fonts that contain "Glyph" and try to get the closest match
to font */
public Font getSimilarFontWithGlyph(int codePoint, Font font);

See also:
http://issues.apache.org/bugzilla/show_bug.cgi?id=39422

Discussion

  • Victor Mote
    Victor Mote
    2006-04-28

    Logged In: YES
    user_id=473201

    Hi Max:

    Thanks for your interest. I just posted a comment to the
    FOP Bugzilla entry that you cited that explains most of
    what you want. Briefly, of the four methods that you
    suggest, the first two are available in the FontUse
    interface. The third item is theoretically possible, but
    probably doesn't help you. You need FontUse instances, not
    Font instances, and to get FontUse instances, encoding must
    be considered. The font selection algorithms already do
    that, and I think that is what you probably need. I don't
    know how to implement the fourth method at all without some
    comprehensive algorithm to determine "closest match".

    Victor Mote

     
  • Victor Mote
    Victor Mote
    2006-04-28

    • status: open --> pending
     
  • Victor Mote
    Victor Mote
    2006-04-28

    Logged In: YES
    user_id=473201

    Reopening. I accidentally closed this issue the last time I
    touched it.

     
  • Victor Mote
    Victor Mote
    2006-04-28

    • assigned_to: nobody --> victormote
     
  • Max Berger
    Max Berger
    2006-04-28

    • status: pending --> closed
     
  • Max Berger
    Max Berger
    2006-04-28

    Logged In: YES
    user_id=99210

    Victor,

    sorry I did not do my research properly, I just saw all these font functions in
    Font and did not look at FontUse. So my original request is obsolete.

    I did, however, find two other wishes, that I'll post as feature requests :)

    Thank you and sorry for the inconvenicence.

    Max