question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

[varLib.mutator] How well do static instances made by mutator match how other engines do it?

See original GitHub issue

I noticed Python 3ā€™s round() functions rounds values ending in .5 up or down, depending on whether the base number is even or odd. The rounded result of such numbers is always even. This affects how the GlyphCoordinates.asInt() works, which (as far as I can see) is responsible for rounding after instance interpolation.

I can imagine that other engines (FreeType, Appleā€™s, MSā€™s) may behave differently.

The even/odd rounding is causing me pain trying to match some existing metrics with phantom point deltas in gvar ā€” in many cases itā€™s just impossible to adjust for an odd advance width value.

But then again, maybe mutator is not the right reference for this. And maybe this is not a solvable issue, maybe Iā€™m trying to do something impossible.

Any thoughts?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:30 (17 by maintainers)

github_iconTop GitHub Comments

4reactions
justvanrossumcommented, Apr 21, 2018

Also, ā€œMonsantoā€ šŸ˜€

1reaction
anthrotypecommented, Apr 20, 2018

The spec says https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview

When converting from float or double data types to 16.16, the following method must be used: Multiply the fractional component by 65536, and round the result to the nearest integer (for fractional values of 0.5 and higher, take the next higher integer; for other fractional values, truncate). Store the result in the low-order word. Move the twoā€™s-complement representation of the integer component into the high-order word.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Static mutants - Stryker Mutator
Static mutants. In mutation testing, not all mutants are created equal. The performance cost for some of them is higher than others. Of...
Read more >
Source code for fontTools.varLib.instancer
Partially instantiate a variable font. The module exports an `instantiateVariableFont` function and CLI that allow to create full instances (i.e. static ...
Read more >
Ap Comp Sci -A - Unit 5 Review Flashcards - Quizlet
Methods the class uses for itself, but the user does not need V. Methods ... The user can change all of the instance...
Read more >
Learn Java: Access, Encapsulation, and Static Methods ...
In Java, instance variables are encapsulated by using the private keyword. ... Mutator methods take one parameter whose type matches the type of...
Read more >
How do you write a static variable in GDScript - Godot Engine
The answer is that "there are no static variables, because those are effectively global, and would be less thread and memory safe than...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found