Hi all,
Last weekend I read through the libnrtype code and put some comments to document what each of the routines do. Probably didn't get 100% correct though, and I wrote in a lot of questions. Could someone scan through the code for the 'Q:'s and see if they can fill in what I couldn't?
Also, I reviewed the Pango API's last night and tried to sort out which groups of API calls would need to be implemented in each of the libnrtype files. I put these as steps in the Roadmap in Wiki. Again, I don't know how accurate I was so would appreciate it if someone could check it over and clarify what I missed. My goal was to drill down far into the details of each step. I feel like I came close, but not close enough, so any help specifying that more precisely would be appreciated.
From what I understand, most of libnrtype consists of functions to look
up typeface names, font family names, metrics, attributes, etc. In effect, it implements a big 'dictionary' of this info, with various functions to get/set the data, initialize structs containing typeface info on the fly as needed (with reference counting), and so forth. For all this stuff, Pango has routines which do exactly the same thing. So these can be switched over pretty directly, I'd guess.
It also has functions for getting outlines of fonts, which I don't totally grok yet, but it looks like there are similar routines in Pango. I can't tell if these would be as straightforward to switch over, since different kinds of structs are involved, so this may be the hard portion of the project.
Beyond the above two things, the vast bulk of the rest of the code seems to be there to implement a class hierarchy. I.e., constructors, init, destructors, virtual functions, yada yada. Pretty straightforward and won't need to be fiddled with this go-around. I don't think C++-ifying it would buy us anything, since we'll probably want to majorly restructure all of this code anyway once we're fully converted over to Pango.
By the way, Pango looks *very* cool - it handles a much wider degree of font styles, types, etc. than we do. Stuff like lower caps, strike-out, etc. I don't think we support these kinds of fonts at all, so we'll be gaining it all. Also, in Fred's pango_test we were able to get an arabic font to display, that didn't work for me at all in Inkscape. So potentially we may be picking up support for a much wider range of fonts, which would be quite cool.
Bryce
On Tue, 2004-06-08 at 20:49, Bryce Harrington wrote:
It also has functions for getting outlines of fonts, which I don't totally grok yet, but it looks like there are similar routines in Pango. I can't tell if these would be as straightforward to switch over, since different kinds of structs are involved, so this may be the hard portion of the project.
Last I looked, pango's API gave you enough information to go to the underlying backend API (e.g. freetype or Win32) and get the outlines from that (e.g. using fonts and glyph indices from a PangoLayout). I could be wrong but I don't believe it has its own outline API.
-mental
On Tue, 8 Jun 2004, MenTaLguY wrote:
On Tue, 2004-06-08 at 20:49, Bryce Harrington wrote:
It also has functions for getting outlines of fonts, which I don't totally grok yet, but it looks like there are similar routines in Pango. I can't tell if these would be as straightforward to switch over, since different kinds of structs are involved, so this may be the hard portion of the project.
Last I looked, pango's API gave you enough information to go to the underlying backend API (e.g. freetype or Win32) and get the outlines from that (e.g. using fonts and glyph indices from a PangoLayout). I could be wrong but I don't believe it has its own outline API.
Ah, okay... Sounds like this may take further research. I suppose it's not vital that it get done for 0.39, but it'd definitely need to be figured out before we switch over to Pango.
Bryce
participants (2)
-
Bryce Harrington
-
MenTaLguY