Re: Generating ligature glyphs
Re: Generating ligature glyphs
- Subject: Re: Generating ligature glyphs
- From: Aki Inoue <email@hidden>
- Date: Thu, 27 Oct 2005 13:34:33 -0700
Rolland,
It would be much much easier just to subclass NSATSTypesetter than to
write your own engine.
The starting point for you would be to override - (void)
willSetLineFragmentRect:(NSRectPointer)lineRect forGlyphRange:
(NSRange)glyphRange usedRect:(NSRectPointer)usedRect baselineOffset:
(float *)baselineOffset;
Aki
Thank you for your response.
I am writing a typesetter.
I use getGlyphsInRange:... to obtain the necessary information to
calculate
line breaks etc. So my precise question is, how do I use the font
information to (a) determine which glyph sequence should be
replaced with
ligature glyph(s) and (b) to obtain the actual NSGlyph representing
the
ligature?
What determines that ‘f’ followed by ‘i’ should be a ligature,
and, how does
one get the ‘fi’ ligature glyph to do the replacement?
This would probably also answer the question as to how to get the
right
hyphen glyph. I see that NSATSTypesetter uses the undocumented call
hyphenGlyphForLocale: on NSFont.
One of the reasons I need to write my own typesetter (in addition
to it
being really interesting) is that I need different behaviour to the
way
NSATSTypesetter lays out text on a line interrupted by a shape:
NSATSTypesetter treats the left and right sides as independent
lines; I want
a common baseline and height.
Rolland Bryan
On 10/26/05 8:00 PM, "Douglas Davidson" <email@hidden> wrote:
On Oct 26, 2005, at 4:40 AM, Rolland Bryan wrote:
How does one force NSLayoutManager to generate ligature glyphs?
There are many sorts of ligatures, but for e.g an "fi" ligature,
what will
happen is that during glyph generation, the glyph generator will
generate the
standard "f" and "i" glyphs. During layout, the typesetter will
determine
from font information that an "fi" ligature is available, and then
replace the
"f" glyph with the "fi" ligature glyph and the "i" glyph with a
padding null
glyph. Generation of the ligature happens during layout because
it depends on
the "f" and the "i" actually appearing adjacent to each other on
the same line
of text. The process is controlled to some extent by text
attributes; for
example, NSLigatureAttributeName can be set to 0 to suppress
ligatures of this
sort.
If you would explain what it is that you are trying to do, and
what you are
seeing, perhaps it would be possible to give more detailed guidance.
Douglas Davidson
_______________________________________________
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
_______________________________________________
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