Re: Modifying line breaks
- From: Owen Taylor <otaylor redhat com>
- To: rsteinke w-link net
- Cc: gtk-list gnome org
- Subject: Re: Modifying line breaks
- Date: Tue, 26 Mar 2002 18:26:40 -0500 (EST)
rsteinke w-link net writes:
> I'd like to modify the way line breaking works in a
> GtkTextView (specifically, to prevent breaking between a / and
> an immediately following alpha character, so /foo isn't broken).
> After digging through the docs for a while, it looks like the
> way to do this is to override the default PangoEngineLang with
> one that checks for this case, and defaults to the old one
> otherwise. Is this reasonable, or even possible? If so, how do
> I do it? I'm guessing pango_module_register() comes in somewhere,
> but I'm not sure how to work the details.
This isn't really what language engines are for, and while it might be
conceivably register a language engine for some made up language tag,
it wouldn't be a good idea; language engines are for handling special
line break requirements of particular human languages.
One particular reason that it isn't a good idea is that the language
engine API is marked as unstable; there are no guarantees of API
or binary compatibility.
You should be able to insert a 'ZERO WIDTH NON-BREAK SPACE' (U+FEFF) at the
location to suppress the line break. It doesn't, unfortunately work
with pango-1.0.0 (renders an unknown char for ZWNBSP), I've just fixed
it in CVS.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]