[PATCH weston] Add font entry to shell section for title fonts

Ryo Munakata ryomnktml at gmail.com
Mon Sep 1 21:13:17 PDT 2014


On Mon, 1 Sep 2014 14:05:42 +0300
Pekka Paalanen <ppaalanen at gmail.com> wrote:

> On Thu, 28 Aug 2014 20:31:37 +0900
> 
> Hi,
> 
> considering that the toytoolkit (well, shared/cairo-util.h here) uses
> cairo_show_text(), which is documented as:
> 
> 	"The cairo_show_text() function call is part of what the cairo
> designers call the "toy" text API. It is convenient for short demos and
> simple programs, but it is not expected to be adequate for serious
> text-using applications. See cairo_show_glyphs() for the "real" text
> display API in cairo."
> - http://cairographics.org/manual/cairo-text.html#cairo-show-text
> 
> I'm not sure being able to choose the font is appropriate. If we wanted
> text to work right, we cannot trust any single font to contain all the
> needed glyphs, which is what cairo_show_text() assumes. We'd need a
> list of fonts to fall back when a glyph is not found.
> 
> If this was just about the toytoolkit alone, I would probably not
> bother with it, but since we use the same code to draw Xwayland
> decorations, maybe doing text rendering properly would be worth it?
> 
> Would be much better to rely on pangocairo, as it seems we already use
> pangocairo when it's available. When pangocairo is disabled in the
> build, we should fall back to the current cairo_show_text().
> 
> Does that make sense?
> 
> 
> Thanks,
> pq

Hi, Pekka.

I agree with you. It makes sense.
I'm working on it.

Here's a few questions:
 * Is pangocairo optional, not a requirement?
   Should I write the code like:
   #ifdef HAVE_PANGOCAIRO	
    /* use pangocairo */
   #else
    /* use cairo */
   #endif
   or can I assume we can use pangocairo for sure?

 * I will add 'fonts' entry to shell section. Is that okay?
   'fonts' entry is a list of fonts: fonts=font1,font2,font3
   Is 'shell' section the right place to add fonts entry?

I think we need a way to choose the fonts.
For example, if you search for something on Google Japan using firefox,
the title of firefox will be garbled because of sans which is a default font.
(I mean mojibake: http://en.wikipedia.org/wiki/Mojibake)

I know Weston is just a reference implementation, not to use for real.
What do you think about it considering the policy of Weston?
Should I continue to work on it?

Thanks.
-- 
Ryo Munakata <ryomnktml at gmail.com>


More information about the wayland-devel mailing list