[gs-devel] Using OpenType (CFF-flavour) fonts

Graham Douglas graham.douglas at readytext.co.uk
Sun Dec 12 15:20:57 UTC 2010

Hello to all

This is my first posting to the list so I'd just
like to say a huge thanks to the GhostScript team for
everything they do in making GS available.

Apologies in advance for this long post.

Just to give a very brief summary: I build GS from
source under Windows (Vista) using Visual Studio ---
thanks too for making that so straightforward to do.
At present, I'm using GhostScript with LuaTeX
(via a simple [ie unpolished!] Lua binding) to make GS
callable directly from LuaTeX.

OK, to my question(s). Apologies in advance if this has
been addressed many times before or is a stupid question...
I have spent quite some time looking for an answer but can't find
one that really covers all the issues.

I would like to use some OpenType (CFF-flavour) fonts at my disposal
but need to understand a little more about the process, especially
accessing some of the glyphs which do not have designated
Unicode code points --- such as small caps and oldstyle numbers, I guess 
because they are just design variations as opposed to being "real 
characters" of a language.

I have FontStudio (fully licenced), FontForge and the Adobe FDK
so can get access all low-level data about the OFT tables, glyph indices
etc etc.

Where I'm kinda lost is making the "bridge" between all that
font info and the PostScript machinery/code I need to write in order to 
access all the glyphs in the font, especially the small caps and 
oldstyle numbers. I know you can use glyphshow to draw any glyph in the
CharStrings dictionary, encoded or not, but that seems a complicated
way to go about things, maybe --- perhaps not?

I can load the OTF fonts with GS and successfully build PDFs.
--- apart from the various glyph variants, ligatures etc.

If I run this simple code at the GS> prompt

/myfontname findfont
/Encoding get

Then I get the encoding vector below.
(I think but am not sure that this is vector is derived from
% $Id: gs_cff.ps 11749 2010-10-01 02:58:15Z alexcher $
% Loader for CFF (compressed) fonts, including OpenType CFFs.)

So, in summary, what else do I need to read or
understand to fully utilise OpenType CFF-flavour
fonts with GS in order to access all the various
glyphs in the font.

--- Is it a matter of reencoding the font?
--- Or, is the CIDFont machinery something that
I need to understand?

Is CIDFont machinery relevant to this situation
--- I have the Adobe specs but not yet fully
read or absorbed them.

Many thanks in advance for any advice or
pointers in the right direction and apologies if the
questions are unclear or a bit confused.

Best wishes


Encoding vector
[/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
f /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
/.notdef /.notd
ef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
/.notdef /.not
def /.notdef /.notdef /.notdef /.notdef /.notdef
/numbersign /dollar /percent /ampersand /quoteright /parenleft 
/parenright /asterisk /
plus /comma /hyphen /period /slash /zero /one /two /three /four /five 
/six /seve
n /eight /nine /colon /semicolon /less /equal /greater /question /at /A 
/B /C /D
  /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z 
/backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d 
/e /f /
g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft 
/bar /brac
eright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
f /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
/.notdef /.notd
ef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
/.notdef /.not
def /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
/.notdef /.no
tdef /exclamdown /cent /sterling /fraction /yen /florin /section 
/currency /quot
esingle /quotedblleft /guillemotleft /guilsinglleft /guilsinglright /fi 
/fl /.no
tdef /endash /dagger /daggerdbl /periodcentered /.notdef /paragraph 
/bullet /quo
tesinglbase /quotedblbase /quotedblright /guillemotright /ellipsis 
/.notdef /questiondown /.notdef /grave /acute /circumflex /tilde /macron 
/dotaccent /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut 
/ogonek /car
on /emdash /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
/.notdef /.notd
ef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
/.notdef /AE /
.notdef /ordfeminine /.notdef /.notdef /.notdef /.notdef /Lslash /Oslash 
/OE /or
dmasculine /.notdef /.notdef /.notdef /.notdef /.notdef /ae /.notdef 
/.notdef /.
notdef /dotlessi /.notdef /.notdef /lslash /oslash /oe /germandbls 
/.notdef /.no
tdef /.notdef /.notdef]

More information about the gs-devel mailing list