Re: Pango in Gnome-terminal, zvt Terminal widget

Hi Owen, Robert,

] On 19 Oct 2000, Owen Taylor wrote:
] > In general, I'd say that using Pango in a terminal widget is a
] > difficult thing to do.
] Agreed. It will be not only highly complex, if not impossible, but it
] won't be much use, as most complex-text languages need proportional fonts
] to look sensible. And if you're using fractional character cells, it's not
] a terminal any more.
I agree and actually, this is the right point where we can have complex scripts
supporting in terminal emulator, ie, gnome-terminal, etc, by using Pango APIs.
For the piece of work which can't be done in terminal emulator due to not
enough data to do on terminal-emulator side, it should be done in terminal-based
application side (if they want to), ie, vi, ...etc.

] This has to do mostly with the Pango font API. Pango does not export a
] fully general font API; instead, what it does is export the necessary
] parts of a font API for selecting fonts. Most of the actual API for
] handling the metrics, encoding, etc, of a font is hidden inside
] shaper modules. 
We might need to check what kinds of APIs those requires for terminal-emulator
to be able to support complex-text scripts. If those APIs are really need,
then, Pango might need to have those APIs. So far, I think, at least the
following Pango APIs would be helpful for terminal-emulator.

void	pango_font_get_glyph_extents(PangoFont *font, PangoGlyph glyph,
			PangoRectangle *ink_rect, PangoRectangle *logical_rect)
void	pango_font_get_metrics(PangoFont *font, const gcar *lang,
			PangoFontMetrics *metrics)

] But a terminal is enough different from displaying normal text that I
] think trying to use the Pango layout APIs is going to be difficult.
] This does depend on your goals: a terminal that just handles shell
] commands is easy enough, but a terminal that can handle curses
] programs has to deal with positioning in a way that is very different
] from continuous text.
That's why trying to have complex script support in terminal-emulator
as much as it should be and the rest would be in their own terminal-based
applications themselves because they are the ones who keeps the context.

] (I actually don't have much of a sense of how a terminal should
] behave in the presence of bidirectional and complex text, so
] I might be very wrong about this) 

] My general feeling is that gnome-terminal should probably continue to
] use traditional X fonts directly until a common replacement font API
] for Linux is agreed upon (at this point, it looks like it will be
] based on client-side fonts and FreeType), and then it should be
] written to use that API directly. I don't think using Pango is really
] appropriate.
Well!!! It seems to be there are 2 things involved, Font APIs and
Layout APIs. Don't know much about Font APIs but, may be, Layout APIs
for those kind of terminal-based applications might be needed (if there are).
Don't have any suggestion for Font APIs but at least, if we can make
sure that Pango's Layout APIs are still enough for terminal emulator
to support complex text scripts, then, we should problably think and
do it in Pango now, I guess.

Chookij V.

] Regards,
]                                         Owen 

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