Re: Modifying line breaks

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.


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