Re: Save font as glyphs?
Re: Save font as glyphs?
- Subject: Re: Save font as glyphs?
- From: Henry Maddocks <email@hidden>
- Date: Sat, 26 Feb 2005 21:57:14 +1300
On 26/02/2005, at 8:17 PM, Lorenzo wrote:
Hi,
I save an NSAttributedString to my document. This string has been
formatted
with the font "XYZ" and a shadow. Then I give this file to an user who
has
not the font "XYZ" installed, so when he opens my document (which is
not
editable) he gets the string with a different font. Wrong.
This is correct. It's called font substitution and without it we'd all
be in a lot of trouble.
So at present time I save a bitmap image of my string in the document.
The
result is that the file is bigger than it should really be.
I guess that I could save the glyphs of the string some way, then when
the
user opens it, I reapply some attributes to the glyphs (like the
shadow),
but I don't know how to do. Is anyone who knows how to do?
Depends what you mean by a glyph. If you are talking about ripping the
glyph data out of the font file then you are also going to have to grab
the associated tables from the font so that you can render the glyphs,
eg. offset tables, kerning tables, character maps etc. Then you are
going to have to some how render your glyphs into bitmaps using these
tables.
What is your document format? Will the viewer app even know how to
associate your glyphs with the docment? You might as well just use the
original font.
If you mean grab the glyphs as bitmaps then you have already done that
with the image of your string and saving the whole string will be way
easier than individual glyphs.
If this isn't working for you then ship the font with your document or
use a font you know your user has on their system.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden