Add Culmus foundry to the vendor list

Maps fonts produced by the Culmus project <http://culmus.sourceforge.net>
to the XLFD foundry name culmus.

For TrueType fonts, maps the vendor code CLM from the TrueType vendor id field.

For Type1 fonts, which use heuristics to guess mappings to XLFD foundries from
words in the copyright notice, add the names of the main contributors to
the Culmus product to recognize the fonts under their copyright.

Patch from Maxim Iorsh
This commit is contained in:
Akira TAGOH 2013-02-07 17:56:17 +09:00
parent 96220a5ed9
commit 72b0480a21
1 changed files with 23 additions and 44 deletions

View File

@ -775,47 +775,26 @@ FcSfntNameLanguage (FT_SfntName *sname)
/* Order is significant. For example, some B&H fonts are hinted by /* Order is significant. For example, some B&H fonts are hinted by
URW++, and both strings appear in the notice. */ URW++, and both strings appear in the notice. */
static const char notice_foundry_data[] = static const char *FcNoticeFoundries[][2] =
"Bigelow\0b&h\0" {
"Adobe\0adobe\0" {"Adobe", "adobe"},
"Bitstream\0bitstream\0" {"Bigelow", "b&h"},
"Monotype\0monotype\0" {"Bitstream", "bitstream"},
"Linotype\0linotype\0" {"Gnat", "culmus"},
"LINOTYPE-HELL\0linotype\0" {"Iorsh", "culmus"},
"IBM\0ibm\0" {"HanYang System", "hanyang"},
"URW\0urw\0" {"Font21", "hwan"},
"International Typeface Corporation\0itc\0" {"IBM", "ibm"},
"Tiro Typeworks\0tiro\0" {"International Typeface Corporation", "itc"},
"XFree86\0xfree86\0" {"Linotype", "linotype"},
"Microsoft\0microsoft\0" {"LINOTYPE-HELL", "linotype"},
"Omega\0omega\0" {"Microsoft", "microsoft"},
"Font21\0hwan\0" {"Monotype", "monotype"},
"HanYang System\0hanyang"; {"Omega", "omega"},
{"Tiro Typeworks", "tiro"},
struct _notice_foundry { {"URW", "urw"},
/* these are the offsets into the {"XFree86", "xfree86"},
* notice_foundry_data array. {"Xorg", "xorg"},
*/
unsigned char notice_offset;
unsigned char foundry_offset;
};
static const struct _notice_foundry FcNoticeFoundries[] = {
{ 0, 8 },
{ 12, 18 },
{ 24, 34 },
{ 44, 53 },
{ 62, 71 },
{ 80, 94 },
{ 103, 107 },
{ 111, 115 },
{ 119, 154 },
{ 158, 173 },
{ 178, 186 },
{ 194, 204 },
{ 214, 220 },
{ 226, 233 },
{ 238, 253 }
}; };
#define NUM_NOTICE_FOUNDRIES (int) (sizeof (FcNoticeFoundries) / sizeof (FcNoticeFoundries[0])) #define NUM_NOTICE_FOUNDRIES (int) (sizeof (FcNoticeFoundries) / sizeof (FcNoticeFoundries[0]))
@ -828,9 +807,8 @@ FcNoticeFoundry(const FT_String *notice)
if (notice) if (notice)
for(i = 0; i < NUM_NOTICE_FOUNDRIES; i++) for(i = 0; i < NUM_NOTICE_FOUNDRIES; i++)
{ {
const struct _notice_foundry *nf = &FcNoticeFoundries[i]; const char *n = FcNoticeFoundries[i][0];
const char *n = notice_foundry_data + nf->notice_offset; const char *f = FcNoticeFoundries[i][1];
const char *f = notice_foundry_data + nf->foundry_offset;
if (strstr ((const char *) notice, n)) if (strstr ((const char *) notice, n))
return (const FcChar8 *) f; return (const FcChar8 *) f;
@ -871,6 +849,7 @@ static const struct {
{ "B&H", "b&h"}, { "B&H", "b&h"},
{ "BITS", "bitstream"}, { "BITS", "bitstream"},
{ "CANO", "cannon"}, { "CANO", "cannon"},
{ "CLM", "culmus"},
{ "DYNA", "dynalab"}, { "DYNA", "dynalab"},
{ "EPSN", "epson"}, { "EPSN", "epson"},
{ "FJ", "fujitsu"}, { "FJ", "fujitsu"},