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 <spit...@gmail.com> wrote:

> On Mon, Sep 11, 2017 at 10:39 PM, Behdad Esfahbod <beh...@behdad.org>
> 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 <psyc...@znc.in> 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: color fonts and CAIRO_OPERATOR_SOURCE

2017-09-11 Thread Behdad Esfahbod
It was actually not that complicated:
https://bugs.freedesktop.org/show_bug.cgi?id=102661

On Mon, Sep 11, 2017 at 1:44 AM, Uli Schlachter <psyc...@znc.in> 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/
___
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
s::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 <psyc...@znc.in>
> > > > 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 <behdad@behd
> > > ad.o
> > > > > 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 <psychon@zn
> > > c.in
> > > > > > wrote:
> > > > > >>>
> > > > > >>>> On 07.07.2017 15:23, Matthias Clasen wrote:
> > > > > >>>>> On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psychon@z
> > > nc.i
> > > > > n> wrote:
> > > > > >>>>>> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> > > > > >>>>>>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" <mclasen@red
> > > hat.
> > > > > com>
> > > > > >>>> wrote:
> > > > > >>>>>>> On Fri, 2017-06-30 at 17:02 +0200, Uli Schlachter
> > > wrote:
> > > > > >>>>>>>> On 28.06.2017 

Re: [cairo] Color fonts

2017-07-29 Thread iofelben
ough, 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 <behdad@behd
> > ad.o
> > > > 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 <psychon@zn
> > c.in
> > > > > wrote:
> > > > >>>
> > > > >>>> On 07.07.2017 15:23, Matthias Clasen wrote:
> > > > >>>>> On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psychon@z
> > nc.i
> > > > n> wrote:
> > > > >>>>>> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> > > > >>>>>>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" <mclasen@red
> > hat.
> > > > 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.
> > > > >>>>>>>>
> > > > >>>>>>>
> > > > >>>>>>> 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.
> > >
> > >
> > >
> > > ___
> > > gtk-devel-list mailing list
> > > gtk-devel-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/gtk-devel-list
> 
> 
> 
___
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 Ben Iofel
 2017 at 1:53 AM, Behdad Esfahbod <behdad@behdad.o
>> > > 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 <psyc...@znc.in
>> > > > wrote:
>> > > >>>
>> > > >>>> On 07.07.2017 15:23, Matthias Clasen wrote:
>> > > >>>>> On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psychon@znc.i
>> > > n> wrote:
>> > > >>>>>> On 30.06.2017 17:29, Behdad Esfahbod wrote:
>> > > >>>>>>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" <mclasen@redhat.
>> > > 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.
>> > > >>>>>>>>
>> > > >>>>>>>
>> > > >>>>>>> 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.
>> >
>> >
>> >
>> > ___
>> > gtk-devel-list mailing list
>> > gtk-devel-list@gnome.org
>> > https://mail.gnome.org/mailman/listinfo/gtk-devel-list
>>
>
>
>
> --
> 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-29 Thread Behdad Esfahbod
e 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 <psyc...@znc.in
> > > > wrote:
> > > >>>
> > > >>>> On 07.07.2017 15:23, Matthias Clasen wrote:
> > > >>>>> On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psychon@znc.i
> > > n> wrote:
> > > >>>>>> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> > > >>>>>>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" <mclasen@redhat.
> > > 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.
> > > >>>>>>>>
> > > >>>>>>>
> > > >>>>>>> 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.
> >
> >
> >
> > ___
> > gtk-devel-list mailing list
> > gtk-devel-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/gtk-devel-list
>



-- 
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-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 <psyc...@znc.in>
> 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 <behdad@behdad.o
> > 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 <psyc...@znc.in
> > > wrote:
> > >>>
> > >>>> On 07.07.2017 15:23, Matthias Clasen wrote:
> > >>>>> On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psychon@znc.i
> > n> wrote:
> > >>>>>> On 30.06.2017 17:29, Behdad Esfahbod wrot

Re: [cairo] Color fonts

2017-07-29 Thread Behdad Esfahbod
On Sat, Jul 29, 2017 at 11:58 AM, Uli Schlachter <psyc...@znc.in> 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 <beh...@behdad.org>
> 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 <psyc...@znc.in>
> wrote:
> >>>
> >>>> On 07.07.2017 15:23, Matthias Clasen wrote:
> >>>>> On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psyc...@znc.in>
> wrote:
> >>>>>> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> >>>>>>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" <mcla...@redhat.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.
> >>>>>>>>
> >>>>>>>
> >>>>>>> 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 <spit...@gmail.com> 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 <beh...@behdad.org>
> 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 <beh...@behdad.org>
> 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 <psyc...@znc.in>
> wrote:
> >>>>
> >>>> On 07.07.2017 15:23, Matthias Clasen wrote:
> >>>> > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psyc...@znc.in>
> wrote:
> >>>> >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> >>>> >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" <mcla...@redhat.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.
> >>>> >>>>
> >>>> >>>
> >>>> >>> 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 <beh...@behdad.org> 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 <psyc...@znc.in> wrote:
>>
>>> On 07.07.2017 15:23, Matthias Clasen wrote:
>>> > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psyc...@znc.in> wrote:
>>> >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
>>> >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" <mcla...@redhat.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.
>>> >>>>
>>> >>>
>>> >>> 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 <matthias.cla...@gmail.com>
wrote:

> On Sat, Jul 15, 2017 at 4:05 AM, Uli Schlachter <psyc...@znc.in> wrote:
>
>> On 07.07.2017 15:23, Matthias Clasen wrote:
>> > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psyc...@znc.in> wrote:
>> >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
>> >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" <mcla...@redhat.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.
>> >>>>
>> >>>
>> >>> 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 <psyc...@znc.in> wrote:

> On 07.07.2017 15:23, Matthias Clasen wrote:
> > On Sat, Jul 1, 2017 at 2:25 AM, Uli Schlachter <psyc...@znc.in> wrote:
> >> On 30.06.2017 17:29, Behdad Esfahbod wrote:
> >>> On Jun 30, 2017 7:51 PM, "Matthias Clasen" <mcla...@redhat.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.
> >>>>
> >>>
> >>> 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: Color fonts

2017-06-30 Thread Matthias Clasen
On Thu, Jun 29, 2017 at 11:18 PM, Matthias Clasen  wrote:

> I had another go at this here:  https://github.com/
> matthiasclasen/cairo/tree/emoji-again
>

I've spent some more time on this branch. It now uses paint only for
clusters that consists
purely of color glyphs, rewriting the inputs to remove handled clusters,
and then falls through
the show_glyphs code paths.

It seems to work ok, at least as far as gedit / pango let me test easily.
I'm less confident that
the CAIRO_TEXT_CLUSTER_FLAG_BACKWARD case is entirely correct, that is hard
for me
to judge.

An unrelated observation: pango treats the gap between an emoji modifier
base and a variant selector
as a cursor position. That looks like a bug.
___
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" <mcla...@redhat.com> 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


Re: Color fonts

2017-06-30 Thread Bastien Nocera
On Thu, 2017-06-29 at 23:18 -0400, Matthias Clasen wrote:
> I had another go at this here:  
> https://github.com/matthiasclasen/cairo/tree/emoji-again

I rebased your old branch on top of 1.14.10 (the current stable):
https://fedorapeople.org/~hadess/emoji/cairo-emoji-5-rebased-on-1.14.10.patch
for posterity more than anything.

I've also updated the COPR. Installing both packages in there should
get you colored emojis in Characters and other GTK+ 3.x apps.

https://copr.fedorainfracloud.org/coprs/hadess/emoji/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Color fonts

2017-06-29 Thread Matthias Clasen
I had another go at this here:
https://github.com/matthiasclasen/cairo/tree/emoji-again
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Color fonts

2017-06-29 Thread Matthias Clasen
On Wed, Jun 28, 2017 at 8:23 AM, Behdad Esfahbod <beh...@behdad.org> wrote:

> Hello,
>
> All of you have asked me about the status of color fonts in cairo.
> There's some discussion here:
>
> https://github.com/googlei18n/noto-emoji/issues/36
>
> The remaining part is indeed the cairo patchset.  Matthias had a reworked
> version, which Chris Wilson objected to.  I agree with parts of his
> objection.  In particular, I don't think we should need to touch every
> compositor.
>
> IMO, this is how it should work:
>
>   - Extend glyph cache to also hold a color-glyph object possibly,
>
>   - Early on, perhals in _cairo_surface_show_text_glyphs(), ask
> scaled_font to see if it has color.  If it does, call a special function
> that iterates over the glyphs, for each, load it and see if it has color.
> Show the color ones using image ops, show the rest using text ops. Or just
> show all as image ops, that's feasible too.
>
> With the above, we wouldn't need to touch any compositor whatsoever.
>
> Unfortunately I'm too busy / lazy to do this any time soon.  However, I
> just bought my ticket to GUADEC, so working on it together there definitely
> is an option.
>
>
Thanks for the guidance on fixing up the cairo patchset. And yay for coming
to GUADEC!
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Color fonts

2017-06-28 Thread Behdad Esfahbod
Hello,

All of you have asked me about the status of color fonts in cairo.  There's
some discussion here:

https://github.com/googlei18n/noto-emoji/issues/36

The remaining part is indeed the cairo patchset.  Matthias had a reworked
version, which Chris Wilson objected to.  I agree with parts of his
objection.  In particular, I don't think we should need to touch every
compositor.

IMO, this is how it should work:

  - Extend glyph cache to also hold a color-glyph object possibly,

  - Early on, perhals in _cairo_surface_show_text_glyphs(), ask scaled_font
to see if it has color.  If it does, call a special function that iterates
over the glyphs, for each, load it and see if it has color.  Show the color
ones using image ops, show the rest using text ops. Or just show all as
image ops, that's feasible too.

With the above, we wouldn't need to touch any compositor whatsoever.

Unfortunately I'm too busy / lazy to do this any time soon.  However, I
just bought my ticket to GUADEC, so working on it together there definitely
is an option.


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