[HarfBuzz] How to increase harfbuzz numerical precision

kelvinsthirteen at gmail.com kelvinsthirteen at gmail.com
Wed Jun 29 00:32:36 UTC 2016


i still don’t get it how does cairo know about the device table in the harfbuzz font object if cairo uses a different font object to do its rendering?

> On Jun 28, 2016, at 8:28 PM, Khaled Hosny <khaledhosny at eglug.org> wrote:
> 
> Device tables affect glyph positioning which is done by HarfBuzz to
> Cairo.
> 
>> On Tue, Jun 28, 2016 at 07:50:51PM -0400, Kelvin Ma wrote:
>> The rendering is separate from harfbuzz i thought, the glyphs get passed to
>> cairo’s cr.show_glyphs() and it uses its own font structure that has to be
>> loaded separately from harfbuzz’s fonts. So any value set on the harfbuzz
>> font is not known by the renderer
>> 
>>> On Tue, Jun 28, 2016 at 7:48 PM, Khaled Hosny <khaledhosny at eglug.org> wrote:
>>> 
>>> For device tables (as I said in my first reply) and I think hinting
>>> (though I don’t think hinting stuff affects HarfBuzz right now).
>>> 
>>>> On Tue, Jun 28, 2016 at 07:25:27PM -0400, Kelvin Ma wrote:
>>>> ok this might be a dumb question but what is ppem used for anyway? I
>>>> thought it was a font value that harfbuzz just lets you read off of the
>>>> font (like upem, advance width, or glyph index) so you can do your own
>>> math
>>>> on the font outside of harfbuzz.
>>>> 
>>>> On Tue, Jun 28, 2016 at 7:18 PM, Khaled Hosny <khaledhosny at eglug.org>
>>> wrote:
>>>> 
>>>>> It is, but you have to set it separately, and then you can set the font
>>>>> scale to whatever value you need without both being interdependent.
>>>>> 
>>>>>> On Tue, Jun 28, 2016 at 07:15:23PM -0400, Kelvin Ma wrote:
>>>>>> I thought ppem was dependent on UPEM and font scale, is it not?
>>>>>> 
>>>>>> On Tue, Jun 28, 2016 at 7:12 PM, Khaled Hosny <khaledhosny at eglug.org
>>>> 
>>>>> wrote:
>>>>>> 
>>>>>>> Device tables depend on ppem, so despite the scale being set
>>>>>>> on the font, you should still set the exact ppem.
>>>>>>> 
>>>>>>> On Tue, Jun 28, 2016 at 06:43:58PM -0400, Kelvin Ma wrote:
>>>>>>>> so that’s the only way huh…
>>>>>>>> doesn’t that kind of defeat the purpose of hb.font_create() and
>>>>> having
>>>>>>> many
>>>>>>>> scaled versions of the same font? You would only ever need one
>>> font
>>>>> of
>>>>>>> each
>>>>>>>> face, scaled to the UPEM, if the fontsize was to be applied
>>>>> externally
>>>>>>>> after shaping already occurred.
>>>>>>>> 
>>>>>>>> On Tue, Jun 28, 2016 at 5:51 PM, Behdad Esfahbod <
>>> behdad at behdad.org>
>>>>>>> wrote:
>>>>>>>> 
>>>>>>>>> HarfBuzz coordinates work in a int32 space.  You are free to
>>> set
>>>>>>> whatever
>>>>>>>>> scales you want on the font.  For example, use 6 or 8 or 10 or
>>> 16
>>>>> bits
>>>>>>> of
>>>>>>>>> sub-pixel precision by multiplying your scale by a number.
>>>>>>>>> 
>>>>>>>>> On Tue, Jun 28, 2016 at 4:57 PM, Kelvin Ma <
>>>>> kelvinsthirteen at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>> 
>>>>>>>>>> It appears that harfbuzz rounds all decimals to integers when
>>>>> giving
>>>>>>>>>> glyph advances and offsets. This is causing some ugly
>>> misalignment
>>>>>>> problems
>>>>>>>>>> in arabic shaping, as well as latin cursive fonts. (see
>>> pictures)
>>>>>>>>>> 
>>>>>>>>>> [image: Inline image 1]
>>>>>>>>>> 
>>>>>>>>>> [image: Inline image 2]
>>>>>>>>>> 
>>>>>>>>>> [image: Inline image 3]
>>>>>>>>>> How do I get harfbuzz to preserve the floats?
>>>>>>>>>> 
>>>>>>>>>> _______________________________________________
>>>>>>>>>> HarfBuzz mailing list
>>>>>>>>>> HarfBuzz at lists.freedesktop.org
>>>>>>>>>> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> --
>>>>>>>>> behdad
>>>>>>>>> http://behdad.org/
>>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> _______________________________________________
>>>>>>>> HarfBuzz mailing list
>>>>>>>> HarfBuzz at lists.freedesktop.org
>>>>>>>> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
>>>>>>> 
>>>>>>> 
>>>>> 
>>> 


More information about the HarfBuzz mailing list