Page 1 of 1
Font Kerning in AmigaOS4?
Posted: Sun Dec 28, 2014 12:31 pm
by blmara
Hi,
I've developed a TrueType font containg some kerning pairs for my music application. The original font editor was TypeSmith but currently High-Logik FontCreator. When I used Text() to output these characters, it seems that the kerning is not applied to the printout, i.e. the character combination 'fp' is not output as close as designed in the editor. Can Text() output kerning or how to proceed here?
Marko
Re: Font Kerning in AmigaOS4?
Posted: Sun Dec 28, 2014 8:10 pm
by chris
blmara wrote:Can Text() output kerning or how to proceed here?
It will definitely work if you plot the glyphs manually, using the kerning information. Text() is not that useful unless you're printing simple text in the system's default charset; I don't think there is any way of making it do kerning.
Re: Font Kerning in AmigaOS4?
Posted: Sun Dec 28, 2014 10:32 pm
by blmara
chris wrote:blmara wrote:Can Text() output kerning or how to proceed here?
It will definitely work if you plot the glyphs manually, using the kerning information. Text() is not that useful unless you're printing simple text in the system's default charset; I don't think there is any way of making it do kerning.
Good to know, thanks. Where could I find the actual kerning information? Do you have code examples?
Marko
Re: Font Kerning in AmigaOS4?
Posted: Sun Dec 28, 2014 11:01 pm
by chris
blmara wrote:Good to know, thanks. Where could I find the actual kerning information? Do you have code examples?
Nothing particularly coherent, but
http://git.netsurf-browser.org/netsurf. ... ont.c#n711 is the code NetSurf uses. ami_font_plot_glyph does the actual plotting. This is effectively the character advance in pixels for a kerned pair:
Code: Select all
if(*char2) EObtainInfo(&ofont->olf_EEngine,
OT_TextKernPair, &kern,
TAG_END);
char_advance = (ULONG)(((glyph->glm_Width - kern) * emwidth) / 65536);
Plot the glyphs and advance using that and you're pretty much there.
Re: Font Kerning in AmigaOS4?
Posted: Mon Dec 29, 2014 10:22 pm
by blmara
chris wrote:
Plot the glyphs and advance using that and you're pretty much there.
Thanks a lot, I look into these!
Marko