Open jonathanpoelen opened 9 months ago
Contrasts under $L^c ±10$ are invalid, and fonts cut off at $L^c ±30$.
I'm not sure what you mean when you say "expected value is 999" ?
I think what is going on is there is no $L^c\ 5$ row in the LUT, so the $L^c\ 0$ row is being returned... but values under $L^c ±10$ are to be disregarded in the current -w3 version.
In order to use values under $L^c ±10$ there is a code extention that must be installed.
My aim was to plot the values -108 to 106 using the result of fontLookupAPCA(). Except that in the -5 to 5 range, the curve doesn't make any sense when it could easily be flat:
0.00, 999, 999, 999, 999, 999, 999, 999, 999, 999
1.00, 999, 999, 999, 999, 999, 999, 999, 999, 999
2.00, 999, 999, 999, 999, 999, 999, 999, 999, 999
3.00, 999, 999, 999, 999, 999, 999, 999, 999, 999
4.00, 999, 999, 999, 999, 999, 999, 999, 999, 999
5.00, 999, 999, 999, 999, 999, 999, 999, 999, 999
Hi @jonathanpoelen
I see, though for apca-w3, there are no valid values under Lc ±7.
But if you are just taking the iterated output of the fontLookupAPCA()
function, I understand the issue.
The interim fix is either to set the first element of the
const fontMatrixAscend = [
['Lc',100,200,300,400,500,600,700,800,900],
[....
To
const fontMatrixAscend = [
['Lc',999,999,999,999,999,999,999,999,999],
[....
Or add a 5
line to all the related arrays.
const fontMatrixAscend = [
['Lc',100,200,300,400,500,600,700,800,900],
[0,999,999,999,999,999,999,999,999,999],
[5,999,999,999,999,999,999,999,999,999], // Insert this line
[10,999,999,999,999,999,999,999,999...
;
const fontDeltaAscend = [
['∆Lc',100,200,300,400,500,600,700,800,900],
[0,0,0,0,0,0,0,0,0,0],
[5,0,0,0,0,0,0,0,0,0], // Insert this line
[10,0,0,0,0,0,0,0,0,0],
;
const contrastArrayAscend = ['lc',0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125];
// ^ insert the 5
Thank you for reporting, it will be corrected in the next update. Please let me know if I can be of further assistance.
Also just FYI, the lookups will be replaced with a pure algorithmic approach in the not too distant future. The LUTs are for developmental purposes.
Describe the bug
In
fontLookupAPCA()
from apca-w3, a contrast less than 5 returns 500, 600, 700, 800 and 900 instead of 999To Reproduce
Expected behavior
All values should be 999.
Additional context
The bug is here: https://github.com/Myndex/apca-w3/blob/master/src/apca-w3.js#L571 which selects index 0 corresponding to a header.
The formula should probably look like
Or else everything is out of sync and it should be
This does not happen using APCAcontrast since the minimum value returned is greater than 7.3 and less than -7.3.