Font Engine

Help
Maxim
2014-03-24
2014-04-11
  • Maxim

    Maxim - 2014-03-24

    Hello crews,

    first of all, thank you for creating and sharing this amazing piece of software!

    I'm one of the developers of Audiveris - an open-source music recognition software written in Java. We're in need of a PDF rendering library. We currently use Ghostscript because the existing free Java libs (PDFBox, PDFRenderer and JPedal) have (still not fixed) rendering issues.

    The solution to use Ghostscript isn't perfect though. We're experiencing a lot of problems with installation and support of native libraries.

    We would prefer a pure Java solution. I've tested your jPodRenderer on a large database of music scores and found out that it works very well.

    We would consider using jPodRenderer in our project. The only problem is that jPodRenderer relies on FreeType, which is in turn a piece of native code we would like to avoid.

    I read somewhere in the web that there is a possibility to use jPodRenderer with another font engine.

    I'm thinking of developing an open-source font parsing engine in Java because I've heard there is nothing comparable to FreeType in Java. Is it still true?

    In order to be able to start I would appreciate it if you would answer the following questions:

    • is it possible to plug in an external font engine directly without recompiling the whole jPodRenderer package? If yes, how can this be achieved?
    • which interface(s) such an external engine should implement in order to be compatible with jPodRenderer? According to your sources, it looks like both IPlatformFontFactory and IPlatformFont are required...
    • I tried to compile jPodRenderer from sources and found out that the recompiled version doesn't work at all. It looks like a compatibility issue with precompiled libraries (is*.jar). Should I consider compiling all required libraries as well? What's about versioning of these libs?

    Thanks in advance!
    Best regards
    Maxim

     
  • mtraut

    mtraut - 2014-03-31

    Hi there,

    sorry for the delay, we're quite busy here at the moment.

    I don't know of any Java based solution comparable to freetype. To write one from scratch sounds ambitionated...

    To plug in a new font engine requires to follow the "service provider" concept implemented in the intarsys runtime, more or less the same as the standard Java service provider.

    In the file META-INF/provider/provider.list add a line with "service;provider", e.g.

     de.intarsys.pdf.platform.cwt.font.IPlatformFontFactory;de.intarsys.pdf.platform.cwt.font.freetype.FreetypeFontFactory
    

    You must partition your deployment accordingly, as you want to skip the freetype based factory.

    The current classes

    FreetypeFontFactory
    FreetypeFont
    *FreetypeGlyphs

    represent a complete rendering plugin.

    We already have a very basic plain AWT based engine - i can send you code if you want to start from here.

    I am not aware of any (binary) incompatibilities. What kind of problems do you have? You can always recompile from scratch if you want to, all sources are included (see dependencies download).

    What do you mean with "versioning"? Do you expect version information added to the jar file name? We tend not to include this in the name. Version information is compiled in the manifest if you need to lookup. Feel free to improve this for your process.

    Ciao, Michael

     
    • Maxim

      Maxim - 2014-04-01

      Hello Michael,

      thank you for your reply which has helped a lot.

      I don't know of any Java based solution comparable to freetype. To write one from scratch sounds ambitionated...

      The question is if it's really necessary to write another font engine from scratch. There is already some java code around. For example, Fontbox (a component of pdfbox) does provide low-level parsers for T1, TrueType, OpenType and AFM/PFB font files. I'm not sure about its compatibility with existing fonts though. Anyway, it would be smarter to improve the existing code than writing a new one from scratch.

      Are you interested in integrating Fontbox as alternative to Freetype? This could be an optional pluggable component (disabled by default). If you do I would provide an appropriate patch.

      We already have a very basic plain AWT based engine - i can send you code if you want to start from here.

      Isn't it already in the source tree as "de.intarsys.pdf.platform.cwt.font.awt" package? If not, I would appreciate it if you'd send me the code to maximumspatium at googlemail point com.

      I am not aware of any (binary) incompatibilities. What kind of problems do you have?

      After recompiling, jPodRenderer didn't work. No document rendered. A cryptic error message said something about providers. It looks like provider.list file is missing. I'll try to add it manually and copy its content from jar provided by Intarsys.

      Best regards
      Maxim

       
      Last edit: Maxim 2014-04-01
  • mtraut

    mtraut - 2014-04-11

    Hi,

    a FontBox integration may be a interesting replacement for FreeType, but i do not know anything about it. If you have a plugin, we are interested in testing it.

    You're right, the AWT code is already contained. Be aware that this is a very rough first sketch. In addition, the provider is commented out in the provider.list.

    Did you track down your runtime problems?

    Michael

     
  • Maxim

    Maxim - 2014-04-11

    Hello Michael,

    If you have a plugin, we are interested in testing it.

    Ok, I'll look into that...

    Did you track down your runtime problems?

    Could you give me a hint about how it works in jPodRenderer?

    Thank you in advance!
    Best regards
    Maxim

     
  • mtraut

    mtraut - 2014-04-11

    Hi Maxim,

    what exactly is "it"?? The plugin/provider mechanics?

    This is what i shortly described above: add a servicename/implementation pair in the "provider.list" file. The required implementation should get clearer from the two implementations provided, one for freetype, one for awt. The lookup is done in de.intarsys.pdf.platform.cwt.font.PlatformFontFactory.get()

    The "provider.list" file is included in the "distribution/resource" directory.

    Ciao Michael

     
  • Maxim

    Maxim - 2014-04-11

    Thank you, Michael,

    sorry if I asked a stupid question!

    I didn't know where to get this "provider.list" from. Now I do.

    I'll try to recompile jPodRenderer later tonight. I hope that this time I'll be more successful.

    Thank you for all your help
    Best regards
    Maxim

     
  • mtraut

    mtraut - 2014-04-11

    There's no such thing as a stupid question (well, most of the time)...

    It was me who didn't understand....

    Hope you succeed, Michael

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks