TrueType fonts can have table in their header information called OS/2. In that there is a Field called FSType that is a bitmap which, if present, specifies embedding permissions.
Does PDFDocument.AddFonts look at and respects those permissions if they are there?
Also what types of fonts/file types are supported?
I think Xojo inc should comment on what the behavior actually is and if they support OTF as well as ttc files
As you are a font expert let me ask you about the flags. The info fro TSType I found said
Note: In the following algorithm, x represents a bit that may be ignored.
But 2 things are not clear to me… From hat this says I would interpret no bits sets to be embeddable… But is that a safe assumption or might to jus mean step author simply did not use that field and might restrict embedding in the human readable license? In other words should I depend only on setting that explicitly permit embedding?
Also I read that the OS/2 table itself is optional.
If the OS/2 Table is not present, should I assume the font is or is not embeddable? Should I not assume it is in that case unless a human readable license says it is?
First the old ones…
Can you clarify support .otf ,.ttc, .otc font files as well a opentype fonts that are NOT based on truetype outlines… And will addFonts NOT embed fonts that have the bit sent not to allow embedding?
Now the new question:
Fonts can have more styles besides plain, Bold Italic and BoldItalic… the can have different weights like Light, Mediums Semi-bold and Black (and they are often packaged together in etc font file). Is there any way to use these fonts styles in the Xojo PDF implementation?
BTW I have written some Xojo code to get the font info both from ttf font files as well as for all the fonts contained in etc files where on can get information on all the styles/weights available…
One thing I don’t know how to deal with are variable weight fonts with respect to that.
I just checked… Unless I messed up my code, almost all of the fonts installed on this Mac are embeddable… the only ones that definitely are not are:
Futura
Gill Sans
Ayuthaya
Brush Script
NISC18030
There are 2 fonts that do not have an OS/2 table and so info on licensing requirements are not specified:
Apple Gothic
Apple Myungjo
Which probably means they are embeddable but I don’t know for sure.
I know…BUT by the spec it can also contain truetype outlines. I know the Xojo implementation supports truetype outlines … I was asking if it supported postscript ones as well.
I know… I looked at the TrueType and OpenType specs and wrote Xojo code to read the tables I care about. I can pull out the the style information on each font in the file… Usually the names of the styles are supplied in the name table in all the languages the fonts support… I wrote my code to pull out the english ones so I could read them!
I can also pull out the name of the company that made it, copyright info , as well as for most fonts , if the font is embeddable ,and if embeddable if the font grants permission for the document to be editable or if the font can be subsetted when embedded, as well as font metrics such as units per em… This is for any truetype or opentype font.
They wanted me to give them my contact info and I don’t need more spam so I passed…
At this point I am pretty confident that my code is reading the permissions bit map from the font file correctly, as I know the other info I am pulling out is correct.
But maybe I will download it just to check one Font that my code says is embeddable and one that says it is not.
@Karen:
Create a free Yahoo mail and use that to get what you want. An if there is SPAM there, you do not care… And you will know for sure from who came that SPAM.
.ttf, .ttc and .otf (TrueType) fonts are supported on PDFDocument. You’ll get the best experience using .ttf font files. With these you can use any of the provided styles, while when using .otf the mileage may vary (usually limited to Regular face).
If the font has the copy protection flags set enabled it is not embedded.
Also, and if you are on macOS, probably you will find of interest the example project found at Example Projects > Platform-Specific > macOS > macOSSystemFonts.xojo_binary_project