Solved

True Type Font Files?

Posted on 2016-09-23
4
112 Views
Last Modified: 2016-09-27
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
0
Comment
Question by:Richard Korts
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
bigeven2002 earned 500 total points
ID: 41813365
Hello,

Did you already try their online conversion tool?  It is located at this page below.  There is no special map file for fonts, that is just the encoding.

http://www.fpdf.org/makefont/

Browse and find the Freestyle script regular font.  Use the ISO-8859-1 encoding which is Western Europe.  It should generated two files, a php file and z file.  The z file is the compressed file.
0
 
LVL 16

Expert Comment

by:DansDadUK
ID: 41813690
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).
0
 

Author Comment

by:Richard Korts
ID: 41813956
bigeven2002,

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

Thanks,

Richard
0
 
LVL 17

Expert Comment

by:bigeven2002
ID: 41813969
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

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question