discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Font fallback based on glyphs/scripts (Was: Multi-lingual cut & past


From: Alexander Malmberg
Subject: Re: Font fallback based on glyphs/scripts (Was: Multi-lingual cut & paste support)
Date: Mon, 04 Aug 2003 20:43:43 +0200

Fred Kiefer wrote:
> Rather the method [NSMutableAttributedString fixFontAttributeInRange:]
> should be implemented in an efficent way.

True. Unfortunately (as always :), there's no real documentation, and
it's a complex issue. Since it affects the attributes stored in the
attributed string, only the absolutely necessary sanity fixing (nothing
in GNUstep) can be applied unconditionally (sometimes, you want to put
those missing character glyphs to use).

Thus, there'd need to be methods for turning the font fallback attribute
fixing off in a text storage, or it would be applied only in certain
cases (eg. only for "indirectly" specified fonts, like the "system
font", but not for explicitly named fonts, like "Helvetica").

Also, I don't think glyph based fallback is a realistic option unless
you're fanatic about getting every character to display. For efficiency
and reasonable results, I think making it script-based is necessary.

Other than that, I haven't had time to look at it; it also interacts
with other things, like symbol fonts and font specific encodings. It's
on my TODO list, so I'll get around to investigating it properly and
implementing it eventually. If anyone knows of any documents or other
implementations of this that could be studied, that would be very
helpful. :)

> What would than still be
> missing is a similar corection for the NSAttributedStrings created by
> the application, but I think our current string drawing code converts
> them into a NSTextStorage anyway, so the same implementation would apply.

Yes, adding it to NSTextStorage would be enough.

> I don't see much reason to implement the font correction in back, when
> it is needed for gui anyway.

It has to be done in -gui at the text system level for correctness.
Doing it in -back would mess up eg. layout and printing.

[snip]
> >  I think it is important that GNUstep can display multiple languages at
> > the same place.
> >  If it is in NSTextView, it is easy by assigning different font to
> > different text with font panel,
> >  though it is troublesome to assign it one by one.
> >  And it is impossible to assign different font in NSTextField or other
> > places.

Most cells do (or should) handle attributed strings, so you can use
different fonts for different parts of them if you want to.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]