Link to home
Create AccountLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

True Type Font Files?

I'm using a thing called fpdf, it is a pdf generator works great, based on php.

It comes with of course a bunch of the "standard" fonts.

I want to use a script style font like Freestyle Script in Word or something similar. Fpdf has a poorly documented feature too make font files (that are php files) from things called .map files, for example cp1250.map.

How can I get a "map" file for Freestyle Script or something similar? Preferably free or small charge.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of bigeven2002
bigeven2002
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I agree with @bigeven2002 regarding "... no special map file for fonts, that is just the encoding ..." (I know nothing about fpdf, so can't comment on that).

Most TrueType / OpenType fonts contain definitions of hundreds (if not thousands) of characters.

For fully 'international' alphabets, applications use a multi-byte encoding; these days, this will usually be Unicode, or the UTF-8 transformation format of this encoding.

Applications which still use single-byte character encodings are limited to a maximum of 256 different characters; it will usually be less than this (typically 192 or 224 'graphic' characters and 64 or 32 non-graphic 'control-code' characters).

The different 'maps', or encodings, are just definitions of which 256-character subset, from the much (much) larger repertoires offered by Unicode, is to be used.

As regards which map / character set to use:

If you want to use single-byte encoding in the Western world, use the ISO-8859-1 Latin-1 set, or perhaps the Windows Latin-1 superset of this (which uses character codes in the 'reserved C1 control codes' range (0x80 -> 0x9f) for additional graphic glyphs, such as the Euro sign).
Avatar of Richard Korts

ASKER

bigeven2002,

OK, that created the files perfectly. Do I have to use AddFont in fpdf to make it available for SetFont?

Thanks,

Richard
OK thanks for the update.  From what I read, yes you will need to run AddFont to make it available:

$pdf->AddFont('FREESCPT','','FREESCPT.php');

Open in new window


Then

$pdf->SetFont('FREESCPT');

Open in new window