Solved

True Type Font Files?

Posted on 2016-09-23
4
62 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now