Java Font and CMAP

Discussion in 'Java' started by keepa, Mar 1, 2006.

  1. keepa

    keepa Guest

    I am writing a charmap application that shows all the characters
    defined in a font. The problem is there is no way to know, at least
    from Java's Font class, what those characters are. It seems that the
    CMAP table in a TTF font file is not exposed by the Font class.

    Is there any way to determine what characters are present in a Font?
    keepa, Mar 1, 2006
    #1
    1. Advertising

  2. keepa

    Roedy Green Guest

    On 1 Mar 2006 13:59:35 -0800, "keepa" <> wrote,
    quoted or indirectly quoted someone who said :

    >Is there any way to determine what characters are present in a Font?


    see http://mindprod.com/jgloss/font.html

    There is a method, but it is not properly implemented.

    In a pinch you read the OpenType Spec and go digging in the font file
    yourself. See http://mindprod.com/jgloss/opentype.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Mar 1, 2006
    #2
    1. Advertising

  3. keepa wrote:
    > I am writing a charmap application that shows all the characters
    > defined in a font. The problem is there is no way to know, at least
    > from Java's Font class, what those characters are. It seems that the
    > CMAP table in a TTF font file is not exposed by the Font class.
    >
    > Is there any way to determine what characters are present in a Font?


    See the various Font.canDisplay...() methods. However, there are two
    issues with them:

    1) They tend not to work properly at all.

    2) The methods' way of working is BS. Either one has to loop (from 0 to
    0x10FFFF), or they loop over a range. Both ways are not really suitable
    for figuring out all available glyphs.

    Maybe you can have a look at apache fop. I seem to remember they have
    own TrueType/OpenType font file reading classes and maybe they provide
    the information you need.

    /Thomas

    --
    The comp.lang.java.gui FAQ:
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
    http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
    Thomas Weidenfeller, Mar 2, 2006
    #3
  4. keepa

    Roedy Green Guest

    On Thu, 02 Mar 2006 09:14:13 +0100, Thomas Weidenfeller
    <> wrote, quoted or indirectly quoted someone
    who said :

    >Maybe you can have a look at apache fop. I seem to remember they have
    >own TrueType/OpenType font file reading classes and maybe they provide
    >the information you need.


    http://xmlgraphics.apache.org/fop/0.20.5/fonts.html#type1-metrics
    I read it they have TrueType and Type 1 but not OpenType support.

    That project needs an overview section. So many of those projects leap
    into the detail without giving you the tiniest clue what the project
    is for or generally how it works.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Mar 2, 2006
    #4
  5. Roedy Green wrote:
    > http://xmlgraphics.apache.org/fop/0.20.5/fonts.html#type1-metrics
    > I read it they have TrueType and Type 1 but not OpenType support.


    I didn't check it. But since OpenType is basically TrueType plus Type 1
    encapsulated in a TrueType format there might still be hope.

    > That project needs an overview section. So many of those projects leap
    > into the detail without giving you the tiniest clue what the project
    > is for or generally how it works.


    Yep. Many web sites, not only many software sites, behave as if every
    visitor is supposed to exactly know what the site is about. I have given
    up counting the number of times where I ended up on some site (e.g. via
    Google), and couldn't for the life of me figure out what it was about,
    if it might potentially be useful for me.

    Even more annoying is that the owners of such sites are very often
    absolutely clue-resistant and can't be bothered to add two or three
    simple sentences to their main page :-( They live in their on little
    universe and simply can't understand it.

    /Thomas
    --
    The comp.lang.java.gui FAQ:
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
    http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
    Thomas Weidenfeller, Mar 2, 2006
    #5
  6. keepa

    keepa Guest

    keepa, Mar 3, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karl Hungus

    Font class, external font files question

    Karl Hungus, Feb 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    510
    Karl Hungus
    Feb 4, 2004
  2. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    688
    Matt Berther
    Feb 20, 2005
  3. gino
    Replies:
    3
    Views:
    3,945
    Mike Smith
    Jul 11, 2004
  4. wial
    Replies:
    2
    Views:
    795
  5. mttc
    Replies:
    2
    Views:
    2,361
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page