Re: [cairo] color fonts and CAIRO_OPERATOR_SOURCE

2017-09-20 Thread Behdad Esfahbod
On Wed, Sep 13, 2017 at 11:07 AM, Bill Spitzak  wrote:

> On Mon, Sep 11, 2017 at 10:39 PM, Behdad Esfahbod 
> wrote:
> > It was actually not that complicated:
> > https://bugs.freedesktop.org/show_bug.cgi?id=102661
>
> Yes that sounds just like my second suggestion.
>
> To deal with the double-premultiply, I would just special-case OVER
> (and perhaps a few other bounded operators). They cause the current
> code to be run where it uses the glyph color+alpha as the source. All
> other compositing operators ignore the glyph color, and use the glyph
> alpha as the letter shape.
>
> SOURCE can then be used to fill the glyph shapes with a constant color.
>

I'm not sure how I feel about that.


> >
> > On Mon, Sep 11, 2017 at 1:44 AM, Uli Schlachter  wrote:
> >>
> >> Hi everyone,
> >>
> >> yesterday I was asked to comment here:
> >>
> >> https://github.com/i3/i3/pull/2925
> >>
> >> The issue seems to be: With operator SOURCE, drawing a color glyph
> >> clears the entire surface. So, while "normal" glyphs are supposed to be
> >> a mask that is then filled, color glyphs seem to be handled as an
> >> unbounded source. This doesn't make a difference for OVER, but for lots
> >> of other operators (at least SOURCE) it obviously matters.
> >>
> >> I didn't investigate this at all. I did not even try to reproduce.
> >> Hence, this ping. Could one of you please look at this, confirm this
> >> really happens, and say what should be done about this? Thanks.
> >>
> >> And yes, in the thread on color fonts, Matthias Clasen answered one of
> >> my questions with:
> >>
> >> >> Okay... so what is the new model? What happens when I draw a color
> >> >> glyph
> >> >> with operator XOR and a red source?
> >> >
> >> >
> >> > The red source is ignored for color glyphs because they are used as
> the
> >> > source.
> >>
> >> So apparently this behaviour is by design, meaning that glyphs can only
> >> really be used with operator OVER any more (well, and some others). So
> >> let me ask this another why: Is this really a good behaviour?
> >>
> >> Oh and one more thing: Who updates cairo's docs and all the explanations
> >> on the web page? ("glyphs work like this, except when they do not").
> >>
> >> Cheers,
> >> Uli
> >>
> >> P.S.: The list of recipents is copied from the recent thread on color
> >> fonts. I have no overview of how people ended up in this list. Sorry if
> >> $YOU are the wrong recipent.
> >> P.P.S: Yes, I also included Gtk-devel-list. I vaguely remember someone
> >> saying that this stuff is relevant there. Dear moderator, sorry for the
> >> work that this causes you.
> >> --
> >> 99 little bugs in the code
> >> 99 little bugs in the code
> >> Take one down, patch it around
> >> 117 little bugs in the code
> >>   -- @irqed
> >
> >
> >
> >
> > --
> > behdad
> > http://behdad.org/
> >
> > --
> > cairo mailing list
> > ca...@cairographics.org
> > https://lists.cairographics.org/mailman/listinfo/cairo
>



-- 
behdad
http://behdad.org/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] color fonts and CAIRO_OPERATOR_SOURCE

2017-09-11 Thread Matthias Clasen
On Mon, Sep 11, 2017 at 4:44 AM, Uli Schlachter  wrote:

>
>
> So apparently this behaviour is by design, meaning that glyphs can only
> really be used with operator OVER any more (well, and some others). So
> let me ask this another why: Is this really a good behaviour?
>

I think you are jumping to conclusions here. The only glyphs for which this
is a problem
with the current code are color glyphs. Most glyphs are still fine with
other operators. One
answer I gave on irc is: if you want to do fancy stuff with text, you
better control which
fonts are involved, so use a custom context (which can avoid loading color
glyphs for the
emoji family). But that is not a great answer. Some ideas for a better one:

- Add an api to find out if a fond has color glpyhs
- Add an api to control loading of color glyphs
- Clip when painting color glyphs to not affect the target outside the
extent of the glyph


> Oh and one more thing: Who updates cairo's docs and all the explanations
> on the web page? ("glyphs work like this, except when they do not").
>

 I can take a look at docs. No idea about the web page.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-07-29 Thread Behdad Esfahbod
Thanks.  That looks unrelated.  Please file a bug against Pango.  Can you
try with Pango master?

On Sat, Jul 29, 2017 at 6:05 PM,  wrote:

> Another crash:
>
> Paste this into gedit:
>
>      ✊ ✌  ✋        ☝    ⬇ ⬅ ➡ ↗ ↖ ↘ ↙ ↔
> ↕  ◀ ▶   ↩ ↪ ⏪ ⏩ ⏫ ⏬ ⤵ ⤴            ⬆
>
> and then select it
>
>
> Pango:ERROR:pango-glyph-item.c:320:pango_glyph_item_iter_next_cluster:
> assertion failed: (iter->end_char <= item->num_chars)
>
>
> #0  0x7fd51d29a68b in raise () at /lib64/libc.so.6
> #1  0x7fd51d29c417 in abort () at /lib64/libc.so.6
> #2  0x7fd51d8da26d in g_assertion_message () at /lib64/libglib-
> 2.0.so.0
> #3  0x7fd51d8da2fa in g_assertion_message_expr () at
> /lib64/libglib-2.0.so.0
> #4  0x7fd51f178076 in  () at /lib64/libpango-1.0.so.0
> #5  0x7fd51f3b110f in pango_cairo_renderer_draw_glyph_item () at
> /lib64/libpangocairo-1.0.so.0
> (gdb) bt 300
> #0  0x7fd51d29a68b in raise () at /lib64/libc.so.6
> #1  0x7fd51d29c417 in abort () at /lib64/libc.so.6
> #2  0x7fd51d8da26d in g_assertion_message () at /lib64/libglib-
> 2.0.so.0
> #3  0x7fd51d8da2fa in g_assertion_message_expr () at
> /lib64/libglib-2.0.so.0
> #4  0x7fd51f178076 in  () at /lib64/libpango-1.0.so.0
> #5  0x7fd51f3b110f in pango_cairo_renderer_draw_glyph_item () at
> /lib64/libpangocairo-1.0.so.0
> #6  0x7fd51f184e1e in pango_renderer_draw_glyph_item () at
> /lib64/libpango-1.0.so.0
> #7  0x7fd51f3b15fd in pango_cairo_show_glyph_item () at
> /lib64/libpangocairo-1.0.so.0
> #8  0x7fd51fba7816 in gtk_text_renderer_draw_glyph_item
> (renderer=0x39caad6040, text=0x39c9fe7c50 "    ✊ ✌  ✋  
>      ☝    ⬇ ⬅ ➡ ↗ ↖ ↘ ↙ ↔ ↕  ◀ ▶   ↩ ↪ ⏪ ⏩ ⏫ ⏬
>  \265 ⤴   ", .
> .., glyph_item=0x39ca1cf810, x=932864, y=14336) at gtktextdisplay.c:334
> #9  0x7fd51f184e1e in pango_renderer_draw_glyph_item () at
> /lib64/libpango-1.0.so.0
> #10 0x7fd51f1858b1 in pango_renderer_draw_layout_line () at
> /lib64/libpango-1.0.so.0
> #11 0x7fd51fba817a in render_para (selection_end_index=-1,
> selection_start_index=-1, line_display=,
> text_renderer=) at gtktextdisplay.c:705
> #12 0x7fd51fba817a in gtk_text_layout_draw (layout=0x39ca4e5d40, wi
> dget=widget@entry=0x39ca5e8610, cr=cr@entry=0x39cab3ab70, widgets=widge
> ts@entry=0x0)
> at gtktextdisplay.c:942
> #13 0x7fd51fbc6504 in gtk_text_view_paint (cr=0x39cab3ab70,
> widget=0x39ca5e8610) at gtktextview.c:5867
> #14 0x7fd51fbc6504 in draw_text (cr=0x39cab3ab70,
> user_data=0x39ca5e8610) at gtktextview.c:5908
> #15 0x7fd51fb333f0 in _gtk_pixel_cache_repaint
> (user_data=0x39ca5e8610, canvas_rect=0x7ffc9f295740,
> view_rect=0x7ffc9f295730, draw=0x7fd51fbc6290 ,
> window=0x39caae2340, cache=0x39ca5e0d00) at gtkpixelcache.c:357
> #16 0x7fd51fb333f0 in _gtk_pixel_cache_draw (cache=0x39ca5e0d00, cr
> =cr@entry=0x39ca4fc8b0, window=window@entry=0x39caae2340, view_rect=vie
> w_rect@entry=0x7ffc9f295730, canvas_rect=canvas_rect@entry=0x7ffc9f2957
> 40, draw=draw@entry=0x7fd51fbc6290 , user_data=0x39ca5e8610)
> at gtkpixelcache.c:447
> #17 0x7fd51fbcb970 in gtk_text_view_draw (widget=0x39ca5e8610,
> cr=0x39ca4fc8b0) at gtktextview.c:5998
> #18 0x7fd52040db2d in gtk_source_view_draw () at
> /lib64/libgtksourceview-3.0.so.1
> #19 0x7fd51fc2d7cb in gtk_widget_draw_internal (widget=widget@entry
> =0x39ca5e8610, cr=cr@entry=0x39ca4fc8b0, clip_to_size=clip_to_size@entr
> y=1) at gtkwidget.c:7017
> #20 0x7fd51fa11ad8 in gtk_container_propagate_draw (container=conta
> iner@entry=0x39ca32f7f0, child=0x39ca5e8610, cr=cr@entry=0x39ca4fc8b0)
> at gtkcontainer.c:3838
> #21 0x7fd51fa11bc2 in gtk_container_draw (widget=0x39ca32f7f0,
> cr=0x39ca4fc8b0) at gtkcontainer.c:3658
> #22 0x7fd51fb6164b in gtk_scrolled_window_render (gadget= out>, cr=0x39ca4fc8b0, x=, y=,
> width=, height=, data=0x0) at
> gtkscrolledwindow.c:2078
> #23 0x7fd51fa16b3d in gtk_css_custom_gadget_draw (gadget= out>, cr=, x=, y=,
> width=, height=) at
> gtkcsscustomgadget.c:159
> #24 0x7fd51fa1b8a3 in gtk_css_gadget_draw (gadget=0x39ca4095e0,
> cr=0x39ca4fc8b0) at gtkcssgadget.c:877
> #25 0x7fd51fb5f931 in gtk_scrolled_window_draw (widget= out>, cr=) at gtkscrolledwindow.c:2989
> #26 0x7fd51fc2d7cb in gtk_widget_draw_internal (widget=widget@entry
> =0x39ca32f7f0, cr=cr@entry=0x39ca4fc8b0, clip_to_size=clip_to_size@entr
> y=1) at gtkwidget.c:7017
> #27 0x7fd51fa11ad8 in gtk_container_propagate_draw (container=conta
> iner@entry=0x39ca05c2c0, child=0x39ca32f7f0, cr=cr@entry=0x39ca4fc8b0)
> at gtkcontainer.c:3838
> #28 0x7fd51fa11bc2 in gtk_container_draw (widget=0x39ca05c2c0, cr=c
> r@entry=0x39ca4fc8b0) at gtkcontainer.c:3658
> #29 0x7fd51f9c3b14 in gtk_box_draw_contents (gadget= out>, cr=0x39ca4fc8b0, x=, y=,
> width=, height=, unused=0x0) at
> gtkbox.c:448
> #30 0x7fd51fa16b3d in gtk_css_custom_gadget_draw (gadget= out>, cr=, x=, y=,
> width=, height=) at
> 

Re: [cairo] Color fonts

2017-07-29 Thread iofelben
Another crash:

Paste this into gedit:

     ✊ ✌  ✋        ☝    ⬇ ⬅ ➡ ↗ ↖ ↘ ↙ ↔ 
↕  ◀ ▶   ↩ ↪ ⏪ ⏩ ⏫ ⏬ ⤵ ⤴            ⬆ 

and then select it


Pango:ERROR:pango-glyph-item.c:320:pango_glyph_item_iter_next_cluster:
assertion failed: (iter->end_char <= item->num_chars)


#0  0x7fd51d29a68b in raise () at /lib64/libc.so.6
#1  0x7fd51d29c417 in abort () at /lib64/libc.so.6
#2  0x7fd51d8da26d in g_assertion_message () at /lib64/libglib-
2.0.so.0
#3  0x7fd51d8da2fa in g_assertion_message_expr () at
/lib64/libglib-2.0.so.0
#4  0x7fd51f178076 in  () at /lib64/libpango-1.0.so.0
#5  0x7fd51f3b110f in pango_cairo_renderer_draw_glyph_item () at
/lib64/libpangocairo-1.0.so.0
(gdb) bt 300
#0  0x7fd51d29a68b in raise () at /lib64/libc.so.6
#1  0x7fd51d29c417 in abort () at /lib64/libc.so.6
#2  0x7fd51d8da26d in g_assertion_message () at /lib64/libglib-
2.0.so.0
#3  0x7fd51d8da2fa in g_assertion_message_expr () at
/lib64/libglib-2.0.so.0
#4  0x7fd51f178076 in  () at /lib64/libpango-1.0.so.0
#5  0x7fd51f3b110f in pango_cairo_renderer_draw_glyph_item () at
/lib64/libpangocairo-1.0.so.0
#6  0x7fd51f184e1e in pango_renderer_draw_glyph_item () at
/lib64/libpango-1.0.so.0
#7  0x7fd51f3b15fd in pango_cairo_show_glyph_item () at
/lib64/libpangocairo-1.0.so.0
#8  0x7fd51fba7816 in gtk_text_renderer_draw_glyph_item
(renderer=0x39caad6040, text=0x39c9fe7c50 "    ✊ ✌  ✋   
     ☝    ⬇ ⬅ ➡ ↗ ↖ ↘ ↙ ↔ ↕  ◀ ▶   ↩ ↪ ⏪ ⏩ ⏫ ⏬  
 \265 ⤴   ", .
.., glyph_item=0x39ca1cf810, x=932864, y=14336) at gtktextdisplay.c:334
#9  0x7fd51f184e1e in pango_renderer_draw_glyph_item () at
/lib64/libpango-1.0.so.0
#10 0x7fd51f1858b1 in pango_renderer_draw_layout_line () at
/lib64/libpango-1.0.so.0
#11 0x7fd51fba817a in render_para (selection_end_index=-1,
selection_start_index=-1, line_display=,
text_renderer=) at gtktextdisplay.c:705
#12 0x7fd51fba817a in gtk_text_layout_draw (layout=0x39ca4e5d40, wi
dget=widget@entry=0x39ca5e8610, cr=cr@entry=0x39cab3ab70, widgets=widge
ts@entry=0x0)
at gtktextdisplay.c:942
#13 0x7fd51fbc6504 in gtk_text_view_paint (cr=0x39cab3ab70,
widget=0x39ca5e8610) at gtktextview.c:5867
#14 0x7fd51fbc6504 in draw_text (cr=0x39cab3ab70,
user_data=0x39ca5e8610) at gtktextview.c:5908
#15 0x7fd51fb333f0 in _gtk_pixel_cache_repaint
(user_data=0x39ca5e8610, canvas_rect=0x7ffc9f295740,
view_rect=0x7ffc9f295730, draw=0x7fd51fbc6290 ,
window=0x39caae2340, cache=0x39ca5e0d00) at gtkpixelcache.c:357
#16 0x7fd51fb333f0 in _gtk_pixel_cache_draw (cache=0x39ca5e0d00, cr
=cr@entry=0x39ca4fc8b0, window=window@entry=0x39caae2340, view_rect=vie
w_rect@entry=0x7ffc9f295730, canvas_rect=canvas_rect@entry=0x7ffc9f2957
40, draw=draw@entry=0x7fd51fbc6290 , user_data=0x39ca5e8610)
at gtkpixelcache.c:447
#17 0x7fd51fbcb970 in gtk_text_view_draw (widget=0x39ca5e8610,
cr=0x39ca4fc8b0) at gtktextview.c:5998
#18 0x7fd52040db2d in gtk_source_view_draw () at
/lib64/libgtksourceview-3.0.so.1
#19 0x7fd51fc2d7cb in gtk_widget_draw_internal (widget=widget@entry
=0x39ca5e8610, cr=cr@entry=0x39ca4fc8b0, clip_to_size=clip_to_size@entr
y=1) at gtkwidget.c:7017
#20 0x7fd51fa11ad8 in gtk_container_propagate_draw (container=conta
iner@entry=0x39ca32f7f0, child=0x39ca5e8610, cr=cr@entry=0x39ca4fc8b0)
at gtkcontainer.c:3838
#21 0x7fd51fa11bc2 in gtk_container_draw (widget=0x39ca32f7f0,
cr=0x39ca4fc8b0) at gtkcontainer.c:3658
#22 0x7fd51fb6164b in gtk_scrolled_window_render (gadget=, cr=0x39ca4fc8b0, x=, y=,
width=, height=, data=0x0) at
gtkscrolledwindow.c:2078
#23 0x7fd51fa16b3d in gtk_css_custom_gadget_draw (gadget=, cr=, x=, y=,
width=, height=) at
gtkcsscustomgadget.c:159
#24 0x7fd51fa1b8a3 in gtk_css_gadget_draw (gadget=0x39ca4095e0,
cr=0x39ca4fc8b0) at gtkcssgadget.c:877
#25 0x7fd51fb5f931 in gtk_scrolled_window_draw (widget=, cr=) at gtkscrolledwindow.c:2989
#26 0x7fd51fc2d7cb in gtk_widget_draw_internal (widget=widget@entry
=0x39ca32f7f0, cr=cr@entry=0x39ca4fc8b0, clip_to_size=clip_to_size@entr
y=1) at gtkwidget.c:7017
#27 0x7fd51fa11ad8 in gtk_container_propagate_draw (container=conta
iner@entry=0x39ca05c2c0, child=0x39ca32f7f0, cr=cr@entry=0x39ca4fc8b0)
at gtkcontainer.c:3838
#28 0x7fd51fa11bc2 in gtk_container_draw (widget=0x39ca05c2c0, cr=c
r@entry=0x39ca4fc8b0) at gtkcontainer.c:3658
#29 0x7fd51f9c3b14 in gtk_box_draw_contents (gadget=, cr=0x39ca4fc8b0, x=, y=,
width=, height=, unused=0x0) at
gtkbox.c:448
#30 0x7fd51fa16b3d in gtk_css_custom_gadget_draw (gadget=, cr=, x=, y=,
width=, height=) at
gtkcsscustomgadget.c:159
#31 0x7fd51fa1b8a3 in gtk_css_gadget_draw (gadget=0x39ca409660,
cr=0x39ca4fc8b0) at gtkcssgadget.c:877
#32 0x7fd51f9c64b1 in gtk_box_draw (widget=,
cr=) at gtkbox.c:457
#33 0x7fd51fc2d7cb in gtk_widget_draw_internal (widget=widget@entry
=0x39ca05c2c0, cr=cr@entry=0x39ca4fc8b0, clip_to_size=clip_to_size@entr
y=1) at gtkwidget.c:7017
#34 

Re: [cairo] Color fonts

2017-07-29 Thread Ben Iofel
Looks great!

On Sat, Jul 29, 2017, 5:43 PM Behdad Esfahbod  wrote:

> Should be fixed.  Thanks!
>
> On Sat, Jul 29, 2017 at 4:45 PM,  wrote:
>
>> Tried to run gnome-characters with Cairo master, switching to noto-
>> color-emoji crashes with:
>>
>> #0  0x7fd0ecd2868b in raise () at /lib64/libc.so.6
>> #1  0x7fd0ecd2a417 in abort () at /lib64/libc.so.6
>> #2  0x7fd0ecd208fa in __assert_fail_base () at /lib64/libc.so.6
>> #3  0x7fd0ecd20972 in  () at /lib64/libc.so.6
>> #4  0x7fd0f1370b6e in _cairo_error (status=status@entry=3646361312)
>> at cairo-error.c:68
>> #5  0x7fd0f1367802 in _cairo_set_error (cr=0x3dd89ecc00,
>> status=3646361312) at cairo.c:400
>> #6  0x7fd0f13691b1 in cairo_show_text_glyphs (cr=0x3dd89ecc00,
>> utf8=0x3dd8a41b40 "", utf8_len=4, glyphs=0x7fffada90d60, num_glyphs=1
>> , clusters=0x7fffada91640, num_clusters=1, cluster_flags=(unknown: 0))
>> at cairo.c:3742
>> #7  0x7fd0f0283f69 in pango_cairo_renderer_show_text_glyphs.isra ()
>> at /lib64/libpangocairo-1.0.so.0
>> #8  0x7fd0f0284161 in pango_cairo_renderer_draw_glyph_item () at
>> /lib64/libpangocairo-1.0.so.0
>> #9  0x7fd0f0057e1e in pango_renderer_draw_glyph_item () at
>> /lib64/libpango-1.0.so.0
>> #10 0x7fd0f00588b1 in pango_renderer_draw_layout_line () at
>> /lib64/libpango-1.0.so.0
>> #11 0x7fd0f0058c65 in pango_renderer_draw_layout () at
>> /lib64/libpango-1.0.so.0
>> #12 0x7fd0f028443a in _pango_cairo_do_layout () at
>> /lib64/libpangocairo-1.0.so.0
>> #13 0x7fd0ef560bde in ffi_call_unix64 () at /lib64/libffi.so.6
>> #14 0x7fd0ef56054f in ffi_call () at /lib64/libffi.so.6
>> #15 0x7fd0f10ab6f6 in  () at /lib64/libgjs.so.0
>> #16 0x7fd0f10ad066 in  () at /lib64/libgjs.so.0
>> #17 0x7fd0ee3626a8 in js::Invoke(JSContext*, JS::CallArgs,
>> js::MaybeConstruct) () at /lib64/libmozjs-38.so
>> #18 0x7fd0ee3584cd in Interpret(JSContext*, js::RunState&) () at
>> /lib64/libmozjs-38.so
>> #19 0x7fd0ee362324 in js::RunScript(JSContext*, js::RunState&) ()
>> at /lib64/libmozjs-38.so
>> #20 0x7fd0ee362614 in js::Invoke(JSContext*, JS::CallArgs,
>> js::MaybeConstruct) () at /lib64/libmozjs-38.so
>> #21 0x7fd0ee664f13 in js_fun_apply(JSContext*, unsigned int,
>> JS::Value*) () at /lib64/libmozjs-38.so
>> #22 0x7fd0ee3626a8 in js::Invoke(JSContext*, JS::CallArgs,
>> js::MaybeConstruct) () at /lib64/libmozjs-38.so
>> #23 0x7fd0ee363243 in js::Invoke(JSContext*, JS::Value const&,
>> JS::Value const&, unsigned int, JS::Value const*,
>> JS::MutableHandle) () at /lib64/libmozjs-38.so
>> #24 0x7fd0ee4b5485 in js::jit::DoCallFallback(JSContext*,
>> js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int,
>> JS::Value*, JS::MutableHandle) ()
>> at /lib64/libmozjs-38.so
>> #25 0x7fd0f1877510 in  ()
>> #26 0x7fffada948a0 in  ()
>> #27 0x7fffada94368 in  ()
>> #28 0x in  ()
>>
>> On Sat, 2017-07-29 at 16:30 +0100, Behdad Esfahbod wrote:
>> > On Sat, Jul 29, 2017 at 11:58 AM, Uli Schlachter 
>> > wrote:
>> > > Hi Behdad
>> > >
>> > > I don't think that is my decision to make. When thinking about
>> > > "fonts in
>> > > cairo", I'm thinking "Behdad". I'm just asking weird questions from
>> > > the
>> > > sideline. :-)
>> >
>> > Thanks. :-)  Pushed  At least ten people already asked me "what's
>> > up with emoji" at GUADEC...
>> >
>> > > Uli
>> > >
>> > > P.S.: How relevant and up to date is the CC list here? I always get
>> > > a
>> > > "your message to gtk-devel-list awaits moderator approval"-mail
>> > > when
>> > > replying to this thread...
>> > >
>> >
>> > My messages go through, yours probably don't because you are not a
>> > member.  It's valuable still.
>> >
>> > Cheers,
>> > b
>> >
>> > > On 28.07.2017 16:38, Behdad Esfahbod wrote:
>> > > > Uli,
>> > > >
>> > > > Can we commit this?  I don't think waiting another few years will
>> > > result in
>> > > > a superior patchset. :)
>> > > >
>> > > > Cheers,
>> > > >
>> > > > behdad
>> > > >
>> > > > On Wed, Jul 19, 2017 at 1:53 AM, Behdad Esfahbod > > > rg> wrote:
>> > > >
>> > > >> Right.  In the future we would want to make it show glyphs in
>> > > the input
>> > > >> order, ie. not separate color vs non-color.  That's the order
>> > > required by
>> > > >> CSS for example.  In a show-text-glyphs call with
>> > > CAIRO_TEXT_CLUSTER_FLAG_BACKWARD,
>> > > >> it might be desirable to show back-to-front.
>> > > >>
>> > > >> On Tue, Jul 18, 2017 at 1:59 PM, Matthias Clasen <
>> > > >> matthias.cla...@gmail.com> wrote:
>> > > >>
>> > > >>> On Sat, Jul 15, 2017 at 4:05 AM, Uli Schlachter > > > > wrote:
>> > > >>>
>> > >  On 07.07.2017 15:23, Matthias Clasen wrote:
>> > > > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter > > > n> wrote:
>> > > >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
>> > > >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" 

Re: [cairo] Color fonts

2017-07-29 Thread Behdad Esfahbod
Should be fixed.  Thanks!

On Sat, Jul 29, 2017 at 4:45 PM,  wrote:

> Tried to run gnome-characters with Cairo master, switching to noto-
> color-emoji crashes with:
>
> #0  0x7fd0ecd2868b in raise () at /lib64/libc.so.6
> #1  0x7fd0ecd2a417 in abort () at /lib64/libc.so.6
> #2  0x7fd0ecd208fa in __assert_fail_base () at /lib64/libc.so.6
> #3  0x7fd0ecd20972 in  () at /lib64/libc.so.6
> #4  0x7fd0f1370b6e in _cairo_error (status=status@entry=3646361312)
> at cairo-error.c:68
> #5  0x7fd0f1367802 in _cairo_set_error (cr=0x3dd89ecc00,
> status=3646361312) at cairo.c:400
> #6  0x7fd0f13691b1 in cairo_show_text_glyphs (cr=0x3dd89ecc00,
> utf8=0x3dd8a41b40 "", utf8_len=4, glyphs=0x7fffada90d60, num_glyphs=1
> , clusters=0x7fffada91640, num_clusters=1, cluster_flags=(unknown: 0))
> at cairo.c:3742
> #7  0x7fd0f0283f69 in pango_cairo_renderer_show_text_glyphs.isra ()
> at /lib64/libpangocairo-1.0.so.0
> #8  0x7fd0f0284161 in pango_cairo_renderer_draw_glyph_item () at
> /lib64/libpangocairo-1.0.so.0
> #9  0x7fd0f0057e1e in pango_renderer_draw_glyph_item () at
> /lib64/libpango-1.0.so.0
> #10 0x7fd0f00588b1 in pango_renderer_draw_layout_line () at
> /lib64/libpango-1.0.so.0
> #11 0x7fd0f0058c65 in pango_renderer_draw_layout () at
> /lib64/libpango-1.0.so.0
> #12 0x7fd0f028443a in _pango_cairo_do_layout () at
> /lib64/libpangocairo-1.0.so.0
> #13 0x7fd0ef560bde in ffi_call_unix64 () at /lib64/libffi.so.6
> #14 0x7fd0ef56054f in ffi_call () at /lib64/libffi.so.6
> #15 0x7fd0f10ab6f6 in  () at /lib64/libgjs.so.0
> #16 0x7fd0f10ad066 in  () at /lib64/libgjs.so.0
> #17 0x7fd0ee3626a8 in js::Invoke(JSContext*, JS::CallArgs,
> js::MaybeConstruct) () at /lib64/libmozjs-38.so
> #18 0x7fd0ee3584cd in Interpret(JSContext*, js::RunState&) () at
> /lib64/libmozjs-38.so
> #19 0x7fd0ee362324 in js::RunScript(JSContext*, js::RunState&) ()
> at /lib64/libmozjs-38.so
> #20 0x7fd0ee362614 in js::Invoke(JSContext*, JS::CallArgs,
> js::MaybeConstruct) () at /lib64/libmozjs-38.so
> #21 0x7fd0ee664f13 in js_fun_apply(JSContext*, unsigned int,
> JS::Value*) () at /lib64/libmozjs-38.so
> #22 0x7fd0ee3626a8 in js::Invoke(JSContext*, JS::CallArgs,
> js::MaybeConstruct) () at /lib64/libmozjs-38.so
> #23 0x7fd0ee363243 in js::Invoke(JSContext*, JS::Value const&,
> JS::Value const&, unsigned int, JS::Value const*,
> JS::MutableHandle) () at /lib64/libmozjs-38.so
> #24 0x7fd0ee4b5485 in js::jit::DoCallFallback(JSContext*,
> js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int,
> JS::Value*, JS::MutableHandle) ()
> at /lib64/libmozjs-38.so
> #25 0x7fd0f1877510 in  ()
> #26 0x7fffada948a0 in  ()
> #27 0x7fffada94368 in  ()
> #28 0x in  ()
>
> On Sat, 2017-07-29 at 16:30 +0100, Behdad Esfahbod wrote:
> > On Sat, Jul 29, 2017 at 11:58 AM, Uli Schlachter 
> > wrote:
> > > Hi Behdad
> > >
> > > I don't think that is my decision to make. When thinking about
> > > "fonts in
> > > cairo", I'm thinking "Behdad". I'm just asking weird questions from
> > > the
> > > sideline. :-)
> >
> > Thanks. :-)  Pushed  At least ten people already asked me "what's
> > up with emoji" at GUADEC...
> >
> > > Uli
> > >
> > > P.S.: How relevant and up to date is the CC list here? I always get
> > > a
> > > "your message to gtk-devel-list awaits moderator approval"-mail
> > > when
> > > replying to this thread...
> > >
> >
> > My messages go through, yours probably don't because you are not a
> > member.  It's valuable still.
> >
> > Cheers,
> > b
> >
> > > On 28.07.2017 16:38, Behdad Esfahbod wrote:
> > > > Uli,
> > > >
> > > > Can we commit this?  I don't think waiting another few years will
> > > result in
> > > > a superior patchset. :)
> > > >
> > > > Cheers,
> > > >
> > > > behdad
> > > >
> > > > On Wed, Jul 19, 2017 at 1:53 AM, Behdad Esfahbod  > > rg> wrote:
> > > >
> > > >> Right.  In the future we would want to make it show glyphs in
> > > the input
> > > >> order, ie. not separate color vs non-color.  That's the order
> > > required by
> > > >> CSS for example.  In a show-text-glyphs call with
> > > CAIRO_TEXT_CLUSTER_FLAG_BACKWARD,
> > > >> it might be desirable to show back-to-front.
> > > >>
> > > >> On Tue, Jul 18, 2017 at 1:59 PM, Matthias Clasen <
> > > >> matthias.cla...@gmail.com> wrote:
> > > >>
> > > >>> On Sat, Jul 15, 2017 at 4:05 AM, Uli Schlachter  > > > wrote:
> > > >>>
> > >  On 07.07.2017 15:23, Matthias Clasen wrote:
> > > > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter  > > n> wrote:
> > > >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> > > >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen"  > > com>
> > >  wrote:
> > > >>> On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter wrote:
> > >  On 28.06.2017 14:23, Behdad Esfahbod wrote:
> > > > All of you have 

Re: [cairo] Color fonts

2017-07-29 Thread iofelben
Tried to run gnome-characters with Cairo master, switching to noto-
color-emoji crashes with:

#0  0x7fd0ecd2868b in raise () at /lib64/libc.so.6
#1  0x7fd0ecd2a417 in abort () at /lib64/libc.so.6
#2  0x7fd0ecd208fa in __assert_fail_base () at /lib64/libc.so.6
#3  0x7fd0ecd20972 in  () at /lib64/libc.so.6
#4  0x7fd0f1370b6e in _cairo_error (status=status@entry=3646361312)
at cairo-error.c:68
#5  0x7fd0f1367802 in _cairo_set_error (cr=0x3dd89ecc00,
status=3646361312) at cairo.c:400
#6  0x7fd0f13691b1 in cairo_show_text_glyphs (cr=0x3dd89ecc00,
utf8=0x3dd8a41b40 "", utf8_len=4, glyphs=0x7fffada90d60, num_glyphs=1
, clusters=0x7fffada91640, num_clusters=1, cluster_flags=(unknown: 0))
at cairo.c:3742
#7  0x7fd0f0283f69 in pango_cairo_renderer_show_text_glyphs.isra ()
at /lib64/libpangocairo-1.0.so.0
#8  0x7fd0f0284161 in pango_cairo_renderer_draw_glyph_item () at
/lib64/libpangocairo-1.0.so.0
#9  0x7fd0f0057e1e in pango_renderer_draw_glyph_item () at
/lib64/libpango-1.0.so.0
#10 0x7fd0f00588b1 in pango_renderer_draw_layout_line () at
/lib64/libpango-1.0.so.0
#11 0x7fd0f0058c65 in pango_renderer_draw_layout () at
/lib64/libpango-1.0.so.0
#12 0x7fd0f028443a in _pango_cairo_do_layout () at
/lib64/libpangocairo-1.0.so.0
#13 0x7fd0ef560bde in ffi_call_unix64 () at /lib64/libffi.so.6
#14 0x7fd0ef56054f in ffi_call () at /lib64/libffi.so.6
#15 0x7fd0f10ab6f6 in  () at /lib64/libgjs.so.0
#16 0x7fd0f10ad066 in  () at /lib64/libgjs.so.0
#17 0x7fd0ee3626a8 in js::Invoke(JSContext*, JS::CallArgs,
js::MaybeConstruct) () at /lib64/libmozjs-38.so
#18 0x7fd0ee3584cd in Interpret(JSContext*, js::RunState&) () at
/lib64/libmozjs-38.so
#19 0x7fd0ee362324 in js::RunScript(JSContext*, js::RunState&) ()
at /lib64/libmozjs-38.so
#20 0x7fd0ee362614 in js::Invoke(JSContext*, JS::CallArgs,
js::MaybeConstruct) () at /lib64/libmozjs-38.so
#21 0x7fd0ee664f13 in js_fun_apply(JSContext*, unsigned int,
JS::Value*) () at /lib64/libmozjs-38.so
#22 0x7fd0ee3626a8 in js::Invoke(JSContext*, JS::CallArgs,
js::MaybeConstruct) () at /lib64/libmozjs-38.so
#23 0x7fd0ee363243 in js::Invoke(JSContext*, JS::Value const&,
JS::Value const&, unsigned int, JS::Value const*,
JS::MutableHandle) () at /lib64/libmozjs-38.so
#24 0x7fd0ee4b5485 in js::jit::DoCallFallback(JSContext*,
js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int,
JS::Value*, JS::MutableHandle) ()
at /lib64/libmozjs-38.so
#25 0x7fd0f1877510 in  ()
#26 0x7fffada948a0 in  ()
#27 0x7fffada94368 in  ()
#28 0x in  ()

On Sat, 2017-07-29 at 16:30 +0100, Behdad Esfahbod wrote:
> On Sat, Jul 29, 2017 at 11:58 AM, Uli Schlachter 
> wrote:
> > Hi Behdad
> > 
> > I don't think that is my decision to make. When thinking about
> > "fonts in
> > cairo", I'm thinking "Behdad". I'm just asking weird questions from
> > the
> > sideline. :-)
> 
> Thanks. :-)  Pushed  At least ten people already asked me "what's
> up with emoji" at GUADEC...
>  
> > Uli
> > 
> > P.S.: How relevant and up to date is the CC list here? I always get
> > a
> > "your message to gtk-devel-list awaits moderator approval"-mail
> > when
> > replying to this thread...
> > 
> 
> My messages go through, yours probably don't because you are not a
> member.  It's valuable still.
> 
> Cheers,
> b
>  
> > On 28.07.2017 16:38, Behdad Esfahbod wrote:
> > > Uli,
> > >
> > > Can we commit this?  I don't think waiting another few years will
> > result in
> > > a superior patchset. :)
> > >
> > > Cheers,
> > >
> > > behdad
> > >
> > > On Wed, Jul 19, 2017 at 1:53 AM, Behdad Esfahbod  > rg> wrote:
> > >
> > >> Right.  In the future we would want to make it show glyphs in
> > the input
> > >> order, ie. not separate color vs non-color.  That's the order
> > required by
> > >> CSS for example.  In a show-text-glyphs call with
> > CAIRO_TEXT_CLUSTER_FLAG_BACKWARD,
> > >> it might be desirable to show back-to-front.
> > >>
> > >> On Tue, Jul 18, 2017 at 1:59 PM, Matthias Clasen <
> > >> matthias.cla...@gmail.com> wrote:
> > >>
> > >>> On Sat, Jul 15, 2017 at 4:05 AM, Uli Schlachter  > > wrote:
> > >>>
> >  On 07.07.2017 15:23, Matthias Clasen wrote:
> > > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter  > n> wrote:
> > >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> > >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen"  > com>
> >  wrote:
> > >>> On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter wrote:
> >  On 28.06.2017 14:23, Behdad Esfahbod wrote:
> > > All of you have asked me about the status of color fonts
> > in
> > > cairo.  There's
> > > some discussion here:
> > 
> >  what was the solution to make this fit into cairo's
> > drawing model?
> >  Text
> >  / glyphs are used as a mask and a mask does not have
> > colors.
> > 
> > 

Re: [cairo] Color fonts

2017-07-29 Thread Behdad Esfahbod
On Sat, Jul 29, 2017 at 11:58 AM, Uli Schlachter  wrote:

> Hi Behdad
>
> I don't think that is my decision to make. When thinking about "fonts in
> cairo", I'm thinking "Behdad". I'm just asking weird questions from the
> sideline. :-)
>

Thanks. :-)  Pushed  At least ten people already asked me "what's up
with emoji" at GUADEC...


> Uli
>
> P.S.: How relevant and up to date is the CC list here? I always get a
> "your message to gtk-devel-list awaits moderator approval"-mail when
> replying to this thread...
>

My messages go through, yours probably don't because you are not a member.
It's valuable still.

Cheers,
b


> On 28.07.2017 16:38, Behdad Esfahbod wrote:
> > Uli,
> >
> > Can we commit this?  I don't think waiting another few years will result
> in
> > a superior patchset. :)
> >
> > Cheers,
> >
> > behdad
> >
> > On Wed, Jul 19, 2017 at 1:53 AM, Behdad Esfahbod 
> wrote:
> >
> >> Right.  In the future we would want to make it show glyphs in the input
> >> order, ie. not separate color vs non-color.  That's the order required
> by
> >> CSS for example.  In a show-text-glyphs call with
> CAIRO_TEXT_CLUSTER_FLAG_BACKWARD,
> >> it might be desirable to show back-to-front.
> >>
> >> On Tue, Jul 18, 2017 at 1:59 PM, Matthias Clasen <
> >> matthias.cla...@gmail.com> wrote:
> >>
> >>> On Sat, Jul 15, 2017 at 4:05 AM, Uli Schlachter 
> wrote:
> >>>
>  On 07.07.2017 15:23, Matthias Clasen wrote:
> > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter 
> wrote:
> >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" 
>  wrote:
> >>> On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter wrote:
>  On 28.06.2017 14:23, Behdad Esfahbod wrote:
> > All of you have asked me about the status of color fonts in
> > cairo.  There's
> > some discussion here:
> 
>  what was the solution to make this fit into cairo's drawing model?
>  Text
>  / glyphs are used as a mask and a mask does not have colors.
> 
> >>>
> >>> There is no solution to that. The assumption in cairo's drawing
> model
> >>> about glyphs/fonts has simply been invalidated by reality.
> >>>
> >>>
> >>> Correct.
> >>
> >> Okay... so what is the new model? What happens when I draw a color
>  glyph
> >> with operator XOR and a red source?
> >
> >
> > The red source is ignored for color glyphs because they are used as
> the
> > source.
> 
>  Hi again,
> 
>  I just came up with another question: How are overlapping glyphs
> handled?
> 
>  Let's say I have a red glyph and a blue glyph and I draw them in such
> a
>  way that they overlap. Let's say this additionally overlaps with a
>  non-colored glyph in the same position and I use a green source with
> 50%
>  alpha (cairo_set_source_rgba(cr, 0, 1, 0, 0.5)).
> 
>  What's the visible result?
> 
> 
> >>> Here is what my implementation does: It renders the color glyphs, in
> >>> order, followed by the non-color glyphs.
> >>>
> >>> In practice, I don't think the case of mixed color and non-color glyphs
> >>> in the same call will be all that common.
> >>> Most apps will explicitly set a color font just for the emoji and they
> >>> won't render regular text with an emoji font,
> >>> with the result that runs of color glyphs and non-color glyphs will
> >>> typically be in separate calls.
> >>>
> >>
> >>
> >>
> >> --
> >> behdad
> >> http://behdad.org/
> >>
> >
> >
> >
>
>
> --
> "Why make things difficult, when it is possible to make them cryptic
> and totally illogical, with just a little bit more effort?" -- A. P. J.
>



-- 
behdad
http://behdad.org/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-07-28 Thread Behdad Esfahbod
On Fri, Jul 28, 2017 at 6:00 PM, Bill Spitzak  wrote:

> I think the stacking order of glyphs can remain undefined for
> cairo_show_glyphs. This seems more like something pango would be in
> charge of.
>

We are talking about order of glyphs drawn in one cairo_show_glyphs(), so I
don't see how this is pango's job.


>
> On Fri, Jul 28, 2017 at 7:38 AM, Behdad Esfahbod 
> wrote:
> > Uli,
> >
> > Can we commit this?  I don't think waiting another few years will result
> in
> > a superior patchset. :)
> >
> > Cheers,
> >
> > behdad
> >
> > On Wed, Jul 19, 2017 at 1:53 AM, Behdad Esfahbod 
> wrote:
> >>
> >> Right.  In the future we would want to make it show glyphs in the input
> >> order, ie. not separate color vs non-color.  That's the order required
> by
> >> CSS for example.  In a show-text-glyphs call with
> >> CAIRO_TEXT_CLUSTER_FLAG_BACKWARD, it might be desirable to show
> >> back-to-front.
> >>
> >> On Tue, Jul 18, 2017 at 1:59 PM, Matthias Clasen
> >>  wrote:
> >>>
> >>> On Sat, Jul 15, 2017 at 4:05 AM, Uli Schlachter 
> wrote:
> 
>  On 07.07.2017 15:23, Matthias Clasen wrote:
>  > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter 
> wrote:
>  >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
>  >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" 
>  >>> wrote:
>  >>> On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter wrote:
>   On 28.06.2017 14:23, Behdad Esfahbod wrote:
>  > All of you have asked me about the status of color fonts in
>  > cairo.  There's
>  > some discussion here:
>  
>   what was the solution to make this fit into cairo's drawing
> model?
>   Text
>   / glyphs are used as a mask and a mask does not have colors.
>  
>  >>>
>  >>> There is no solution to that. The assumption in cairo's drawing
>  >>> model
>  >>> about glyphs/fonts has simply been invalidated by reality.
>  >>>
>  >>>
>  >>> Correct.
>  >>
>  >> Okay... so what is the new model? What happens when I draw a color
>  >> glyph
>  >> with operator XOR and a red source?
>  >
>  >
>  > The red source is ignored for color glyphs because they are used as
>  > the
>  > source.
> 
>  Hi again,
> 
>  I just came up with another question: How are overlapping glyphs
>  handled?
> 
>  Let's say I have a red glyph and a blue glyph and I draw them in such
> a
>  way that they overlap. Let's say this additionally overlaps with a
>  non-colored glyph in the same position and I use a green source with
> 50%
>  alpha (cairo_set_source_rgba(cr, 0, 1, 0, 0.5)).
> 
>  What's the visible result?
> 
> >>>
> >>> Here is what my implementation does: It renders the color glyphs, in
> >>> order, followed by the non-color glyphs.
> >>>
> >>> In practice, I don't think the case of mixed color and non-color glyphs
> >>> in the same call will be all that common.
> >>> Most apps will explicitly set a color font just for the emoji and they
> >>> won't render regular text with an emoji font,
> >>> with the result that runs of color glyphs and non-color glyphs will
> >>> typically be in separate calls.
> >>
> >>
> >>
> >>
> >> --
> >> behdad
> >> http://behdad.org/
> >
> >
> >
> >
> > --
> > behdad
> > http://behdad.org/
> >
> > --
> > cairo mailing list
> > ca...@cairographics.org
> > https://lists.cairographics.org/mailman/listinfo/cairo
>



-- 
behdad
http://behdad.org/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-07-28 Thread Behdad Esfahbod
Uli,

Can we commit this?  I don't think waiting another few years will result in
a superior patchset. :)

Cheers,

behdad

On Wed, Jul 19, 2017 at 1:53 AM, Behdad Esfahbod  wrote:

> Right.  In the future we would want to make it show glyphs in the input
> order, ie. not separate color vs non-color.  That's the order required by
> CSS for example.  In a show-text-glyphs call with 
> CAIRO_TEXT_CLUSTER_FLAG_BACKWARD,
> it might be desirable to show back-to-front.
>
> On Tue, Jul 18, 2017 at 1:59 PM, Matthias Clasen <
> matthias.cla...@gmail.com> wrote:
>
>> On Sat, Jul 15, 2017 at 4:05 AM, Uli Schlachter  wrote:
>>
>>> On 07.07.2017 15:23, Matthias Clasen wrote:
>>> > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter  wrote:
>>> >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
>>> >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" 
>>> wrote:
>>> >>> On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter wrote:
>>>  On 28.06.2017 14:23, Behdad Esfahbod wrote:
>>> > All of you have asked me about the status of color fonts in
>>> > cairo.  There's
>>> > some discussion here:
>>> 
>>>  what was the solution to make this fit into cairo's drawing model?
>>>  Text
>>>  / glyphs are used as a mask and a mask does not have colors.
>>> 
>>> >>>
>>> >>> There is no solution to that. The assumption in cairo's drawing model
>>> >>> about glyphs/fonts has simply been invalidated by reality.
>>> >>>
>>> >>>
>>> >>> Correct.
>>> >>
>>> >> Okay... so what is the new model? What happens when I draw a color
>>> glyph
>>> >> with operator XOR and a red source?
>>> >
>>> >
>>> > The red source is ignored for color glyphs because they are used as the
>>> > source.
>>>
>>> Hi again,
>>>
>>> I just came up with another question: How are overlapping glyphs handled?
>>>
>>> Let's say I have a red glyph and a blue glyph and I draw them in such a
>>> way that they overlap. Let's say this additionally overlaps with a
>>> non-colored glyph in the same position and I use a green source with 50%
>>> alpha (cairo_set_source_rgba(cr, 0, 1, 0, 0.5)).
>>>
>>> What's the visible result?
>>>
>>>
>> Here is what my implementation does: It renders the color glyphs, in
>> order, followed by the non-color glyphs.
>>
>> In practice, I don't think the case of mixed color and non-color glyphs
>> in the same call will be all that common.
>> Most apps will explicitly set a color font just for the emoji and they
>> won't render regular text with an emoji font,
>> with the result that runs of color glyphs and non-color glyphs will
>> typically be in separate calls.
>>
>
>
>
> --
> behdad
> http://behdad.org/
>



-- 
behdad
http://behdad.org/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-07-18 Thread Behdad Esfahbod
Right.  In the future we would want to make it show glyphs in the input
order, ie. not separate color vs non-color.  That's the order required by
CSS for example.  In a show-text-glyphs call with
CAIRO_TEXT_CLUSTER_FLAG_BACKWARD, it might be desirable to show
back-to-front.

On Tue, Jul 18, 2017 at 1:59 PM, Matthias Clasen 
wrote:

> On Sat, Jul 15, 2017 at 4:05 AM, Uli Schlachter  wrote:
>
>> On 07.07.2017 15:23, Matthias Clasen wrote:
>> > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter  wrote:
>> >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
>> >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" 
>> wrote:
>> >>> On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter wrote:
>>  On 28.06.2017 14:23, Behdad Esfahbod wrote:
>> > All of you have asked me about the status of color fonts in
>> > cairo.  There's
>> > some discussion here:
>> 
>>  what was the solution to make this fit into cairo's drawing model?
>>  Text
>>  / glyphs are used as a mask and a mask does not have colors.
>> 
>> >>>
>> >>> There is no solution to that. The assumption in cairo's drawing model
>> >>> about glyphs/fonts has simply been invalidated by reality.
>> >>>
>> >>>
>> >>> Correct.
>> >>
>> >> Okay... so what is the new model? What happens when I draw a color
>> glyph
>> >> with operator XOR and a red source?
>> >
>> >
>> > The red source is ignored for color glyphs because they are used as the
>> > source.
>>
>> Hi again,
>>
>> I just came up with another question: How are overlapping glyphs handled?
>>
>> Let's say I have a red glyph and a blue glyph and I draw them in such a
>> way that they overlap. Let's say this additionally overlaps with a
>> non-colored glyph in the same position and I use a green source with 50%
>> alpha (cairo_set_source_rgba(cr, 0, 1, 0, 0.5)).
>>
>> What's the visible result?
>>
>>
> Here is what my implementation does: It renders the color glyphs, in
> order, followed by the non-color glyphs.
>
> In practice, I don't think the case of mixed color and non-color glyphs in
> the same call will be all that common.
> Most apps will explicitly set a color font just for the emoji and they
> won't render regular text with an emoji font,
> with the result that runs of color glyphs and non-color glyphs will
> typically be in separate calls.
>



-- 
behdad
http://behdad.org/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-07-18 Thread Matthias Clasen
On Sat, Jul 15, 2017 at 4:05 AM, Uli Schlachter  wrote:

> On 07.07.2017 15:23, Matthias Clasen wrote:
> > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter  wrote:
> >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen"  wrote:
> >>> On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter wrote:
>  On 28.06.2017 14:23, Behdad Esfahbod wrote:
> > All of you have asked me about the status of color fonts in
> > cairo.  There's
> > some discussion here:
> 
>  what was the solution to make this fit into cairo's drawing model?
>  Text
>  / glyphs are used as a mask and a mask does not have colors.
> 
> >>>
> >>> There is no solution to that. The assumption in cairo's drawing model
> >>> about glyphs/fonts has simply been invalidated by reality.
> >>>
> >>>
> >>> Correct.
> >>
> >> Okay... so what is the new model? What happens when I draw a color glyph
> >> with operator XOR and a red source?
> >
> >
> > The red source is ignored for color glyphs because they are used as the
> > source.
>
> Hi again,
>
> I just came up with another question: How are overlapping glyphs handled?
>
> Let's say I have a red glyph and a blue glyph and I draw them in such a
> way that they overlap. Let's say this additionally overlaps with a
> non-colored glyph in the same position and I use a green source with 50%
> alpha (cairo_set_source_rgba(cr, 0, 1, 0, 0.5)).
>
> What's the visible result?
>
>
Here is what my implementation does: It renders the color glyphs, in order,
followed by the non-color glyphs.

In practice, I don't think the case of mixed color and non-color glyphs in
the same call will be all that common.
Most apps will explicitly set a color font just for the emoji and they
won't render regular text with an emoji font,
with the result that runs of color glyphs and non-color glyphs will
typically be in separate calls.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-07-11 Thread Behdad Esfahbod
On Fri, Jul 7, 2017 at 5:53 PM, Matthias Clasen 
wrote:

> On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter  wrote:
>
>>
>> Okay... so what is the new model? What happens when I draw a color glyph
>> with operator XOR and a red source?
>
>
> The red source is ignored for color glyphs because they are used as the
> source.
>

Note that while with Google's (CBDT/CBLC) and Apple's (sbix) color font
formats the red source will be ignored, with the Microsoft (COLR/CPAL) and
Adobe's (SVG/CPAL) the font can have color imaging as well as using the
current foreground color.  So, the glyph image won't be just a source
either.  It will be a mix of source and mask...  Right now those two
formats are not implemented in FreeType though.

-- 
behdad
http://behdad.org/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-07-11 Thread Behdad Esfahbod
On Fri, Jul 7, 2017 at 5:55 PM, Matthias Clasen 
wrote:

> It would be great to know if this approach, following Behdad's
> recommendation, will be acceptable.
>

Thanks for the quick implementation.  I quite like your changes and think
this is the right way to do it.


> Review of the changes in https://github.com/matthiasclasen/cairo/tree/
> emoji-again would appreciated as well.
>

I like it after your simplification.  I'll try to review the tricky part
you requested.


> I admit that I haven't thought about necessary documentation updates yet.
>



-- 
behdad
http://behdad.org/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-07-07 Thread Matthias Clasen
It would be great to know if this approach, following Behdad's
recommendation, will be acceptable.
Review of the changes in
https://github.com/matthiasclasen/cairo/tree/emoji-again would appreciated
as well.
I admit that I haven't thought about necessary documentation updates yet.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-06-30 Thread Behdad Esfahbod
On Jun 30, 2017 7:51 PM, "Matthias Clasen"  wrote:

On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter wrote:
> Hi,
>
> On 28.06.2017 14:23, Behdad Esfahbod wrote:
> > All of you have asked me about the status of color fonts in
> > cairo.  There's
> > some discussion here:
>
> what was the solution to make this fit into cairo's drawing model?
> Text
> / glyphs are used as a mask and a mask does not have colors.
>

There is no solution to that. The assumption in cairo's drawing model
about glyphs/fonts has simply been invalidated by reality.


Correct.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: [cairo] Color fonts

2017-06-30 Thread Matthias Clasen
On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter wrote:
> Hi,
> 
> On 28.06.2017 14:23, Behdad Esfahbod wrote:
> > All of you have asked me about the status of color fonts in
> > cairo.  There's
> > some discussion here:
> 
> what was the solution to make this fit into cairo's drawing model?
> Text
> / glyphs are used as a mask and a mask does not have colors.
> 

There is no solution to that. The assumption in cairo's drawing model
about glyphs/fonts has simply been invalidated by reality.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list