[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add ly:get-font-format to get the font format (issue 296350043 by addres

From: lemzwerg
Subject: Add ly:get-font-format to get the font format (issue 296350043 by address@hidden)
Date: Fri, 03 Jun 2016 13:06:48 -0700

You were faster than me :-)

LGTM, but note that FreeType's `FT_Get_Font_Format` doesn't really
return the font format but the name of the module used to handle a font.
 In particular, it doesn't make a difference between PFA and PFB.

While I haven't started coding yet, I've played around to write a
documentation string first.  Here is what I cooked up yesterday.

LY_DEFINE (ly_font_format_for_conversion,
           1, 0, 0,
           (SCM font_file_name),
           "Return the font format of the font file as a symbol,
           " how to convert it to a resource that can be embedded into
           " PostScript output file as created by LilyPond.  Possible
           " are @code{'TrueType}, @code{'PFA}, @code{'PFB},
           " @code{'CID}, @code{'CFF}, and @code{'OTF}.  If the font
           " is not recognized or not supported, @code{'()} gets
           "Fonts tagged as @code{'TrueType} can be converted to a"
           " PostScript address@hidden font resource with function"
           " @code{ly:ttf->pfa}.  @code{'PFB} is a binary address@hidden
           " that must be converted to a address@hidden font resource with"

           " function @code{ly:pfb->pfa}.  @code{'OTF} indicates a CFF"
           " contained in an SFNT wrapper; it should be converted to a
           " CFF with function @code{ly:otf->cff}.\n"
           "Bare CFFs (tagged as @code{'CFF}) should be converted to an"
           " embeddable resource with function @code{ps-embed-cff}.
           " address@hidden fonts (tagged as @code{'PFA}) should be
           " to embeddable resources with function
           "Bare CID and address@hidden font resources (tagged as
           " and @code{'Type42}, respectively) can be directly embedded"
           " into the output.")

Such a function could be then used to rewrite `font-file-as-ps-string`
to avoid any dependency on the file extension.
File lily/ (right):
lily/ " returning it as a string.  The
Wouldn't it be better to return a symbol instead?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]