Re: ftbench update: make integrated

2023-08-02 Thread Werner LEMBERG


> I have done the changes you want.

Thanks!

>> 36.5% run difference is bd. AFAICS, you haven't yet worked on
>> omitting 'warmup' iterations, right?
>
> I am planning to increase the iteration count by 10% and ignore the
> results for them.

You mean you are going to ignore the first 10% of the iterations?
This might be a good default.  However, I still think that a
`--warmup` command-line option makes sense to control this.

> Trying to figure out the benchmarking program but actually drowning
> in 1500 lines of code.

:-)  I hope you can eventually find what you need.


Werner



Re: Progress update on alternative rendering engines project

2023-08-02 Thread Werner LEMBERG

> I am currently working on implementing optimizations from fontdue in
> the `dense` module.

Any progress code-wise?  Two weeks have passed, and I only see minor
adjustments to the MarkDown document conversions – and no report from
you :-)


Werner


Re: Progress update on adjustment database

2023-08-02 Thread Craig White
It's pushed.  If you're testing this yourself, keep in mind that the
adjustment will only be applied to n with tilde.  Any other letter with a
tilde can be used as a control group.

The commit also has the vertical adjustment mode that pushes the bottom
contour down, which I haven't found characters to test on yet.

On Wed, Aug 2, 2023 at 6:29 PM Craig White  wrote:

> Thanks for your help.  I fixed the issue by marking all on-curve points
> that I moved as touched (and letting IUP do the rest), setting oy = y, and
> applying the stretch to fy as well.  I also had some calculation errors in
> the height measurement the debug prints used and the algorithm itself.
>
> The next problem is that I relied on an assumption that if the original
> height of the tilde was about 2 pixels tall, the grid-fitted position would
> probably be 2 pixels.  My method estimates the width of the tilde by
> looking for the points at the tips of the tilde curves and measuring their
> distance to the bounding box (see the attached image for a visualization),
> then adding 1 pixel and scaling the contour vertically, anchored at its
> lowest point, until it is at least that tall.
>
> Testing with Liberation Sans, the sizes that had flat tildes before still
> have flat tildes.  I can add more than 1 pixel to the measurement to
> unflatten them, but that causes unnecessarily tall tildes at other sizes.
> I have confirmed by commenting/uncommenting steps of the hinting process
> that af_glyph_hints_align_edge_points is the function that snaps the tilde
> back to flat, so if my understanding is correct, the points at the top and
> bottom of the tilde are forming edges and are being rounded towards each
> other, causing the tilde to remain flat.  How should I proceed?
>
> I'll also push the code I have after removing the dead code and debug
> prints that have built up.
>
> On Mon, Jul 31, 2023 at 6:23 PM Werner LEMBERG  wrote:
>
>>
>> > I have an algorithm I'm testing for the tilde unflattening.  I went
>> > with doing it before all steps, because it worked better with my
>> > idea, but the function af_glyph_hints_align_weak_points is undoing
>> > my changes.
>>
>> Hmm.  Have you checked the OpenType specification how the IUP
>> instruction works?
>>
>>
>> https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions#interpolate-untouched-points-through-the-outline
>>
>> Have you 'touched' the points you move (i.e., setting
>> `AF_FLAG_TOUCH_Y`) so that `af_glyph_hints_align_weak_points` doesn't
>> move them again?
>>
>>
>> Werner
>>
>


Re: Progress update on adjustment database

2023-08-02 Thread Craig White
Thanks for your help.  I fixed the issue by marking all on-curve points
that I moved as touched (and letting IUP do the rest), setting oy = y, and
applying the stretch to fy as well.  I also had some calculation errors in
the height measurement the debug prints used and the algorithm itself.

The next problem is that I relied on an assumption that if the original
height of the tilde was about 2 pixels tall, the grid-fitted position would
probably be 2 pixels.  My method estimates the width of the tilde by
looking for the points at the tips of the tilde curves and measuring their
distance to the bounding box (see the attached image for a visualization),
then adding 1 pixel and scaling the contour vertically, anchored at its
lowest point, until it is at least that tall.

Testing with Liberation Sans, the sizes that had flat tildes before still
have flat tildes.  I can add more than 1 pixel to the measurement to
unflatten them, but that causes unnecessarily tall tildes at other sizes.
I have confirmed by commenting/uncommenting steps of the hinting process
that af_glyph_hints_align_edge_points is the function that snaps the tilde
back to flat, so if my understanding is correct, the points at the top and
bottom of the tilde are forming edges and are being rounded towards each
other, causing the tilde to remain flat.  How should I proceed?

I'll also push the code I have after removing the dead code and debug
prints that have built up.

On Mon, Jul 31, 2023 at 6:23 PM Werner LEMBERG  wrote:

>
> > I have an algorithm I'm testing for the tilde unflattening.  I went
> > with doing it before all steps, because it worked better with my
> > idea, but the function af_glyph_hints_align_weak_points is undoing
> > my changes.
>
> Hmm.  Have you checked the OpenType specification how the IUP
> instruction works?
>
>
> https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions#interpolate-untouched-points-through-the-outline
>
> Have you 'touched' the points you move (i.e., setting
> `AF_FLAG_TOUCH_Y`) so that `af_glyph_hints_align_weak_points` doesn't
> move them again?
>
>
> Werner
>