Re: On PS FontName
- To: Behdad Esfahbod <behdad@xxxxxxxxxx>
- Subject: Re: On PS FontName
- From: James Cloos <cloos@xxxxxxxxxxx>
- Date: Wed, 24 Feb 2010 17:56:38 -0500
- Cc: Fontconfig <fontconfig@xxxxxxxxxxxxxxxxxxxxx>
- Copyright: Copyright 2009 James Cloos
- Delivered-to: fontconfig@xxxxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jhcloos.com; s=eagle; t=1267052251; bh=B8Yb5W74qn0dJ3QMtM7LSBK1v1mn7AhVldJvKriqh90=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=BLuO6Di11GJc38eh07U1uuaxgOAVELn2iLOLp519R3dg05HJO99MLFT8yk+X0tRxJ kL4UjUsS07ycZPCY0iXH2Im+ym1t4cUHWaSQFjTDhBvaBJSJXncGs/sdOI3HpAv+fP fpxh2mCpG8/E4v9TPPGiCCzb1aCg1gNweXdk8VEo=
- In-reply-to: <4B849DC8.1070905@xxxxxxxxxx> (Behdad Esfahbod's message of "Tue, 23 Feb 2010 22:32:24 -0500")
- Openpgp: ED7DAEA6; url=http://jhcloos.com/public_key/0xED7DAEA6.asc
- Openpgp-fingerprint: E9E9 F828 61A4 6EA9 0F2B 63E7 997A 9F17 ED7D AEA6
- References: <4B849DC8.1070905@xxxxxxxxxx>
- User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.90 (gnu/linux)
>>>>> "B" == Behdad Esfahbod <behdad@xxxxxxxxxx> writes:
B> I was wondering if anyne can point me to the canonical way to form the PS
B> FontName from a Fontonfig pattern. A quick search didn't get me anywhere.
There isn't one, given that fc does not cache the PS fontname.
That said, apps which know a PS FontName and want to use fc to try and
find that font on the filesystem will likely split on the last '-', use
everything before that hyphen as a name and attempt to parse what comes
after into width/weight/slant.
Doing that in reverse will work for many fonts, but not for all.
Several fonts use abbreviations w/in the ps name because of the
31 character maximum length.
To do it from a shell script, as things stand, I would use fc-match to
get the filename and pass that to otfinfo -p (from lcdf typetools) to
recover the psname. Or, if the file is a type1 I'd pass it to t1ascii
and parse the result for /FontName.
Only if fc were to cache the /FontName from type1 dicts and the
TT_NAME_ID_PS_NAME from SFNTs could apps search for that and get
back a full pattern. Whether splitting off width/weight/slant
still should be required is an interesting question.
-JimC
--
James Cloos <cloos@xxxxxxxxxxx> OpenPGP: 1024D/ED7DAEA6
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig
[Fedora Users]
[Fedora Cloud]
[Kernel]
[Fedora Legacy]
[Fedora Packaging]
[Fedora Desktop]
[PAM]
[Red Hat Development]
[Red Hat 9]
[Gimp]
[Yosemite News]