Commit 02027ba
committed
Combine the
This avoids duplicating the charCode/glyphId lookup, and (slightly) shortens the code. In particular:
- Given that the path-data is returned as a TypedArray, it's easy enough to instead return `null` to indicate that the glyph was previously compiled.
- The charCode-cache can be changed into a Set, since we only need to track the "seen" charCodes and not their relation to the glyphIds.
- The `compileFontPathInfo` call is moved into `CompiledFont` class, since that simplifies the `src/core/evaluator.js` code a tiny bit.getPathJs and hasBuiltPath methods in the CompiledFont class1 parent eddd70a commit 02027ba
2 files changed
Lines changed: 17 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
| |||
83 | 79 | | |
84 | 80 | | |
85 | 81 | | |
| 82 | + | |
86 | 83 | | |
87 | 84 | | |
88 | 85 | | |
| |||
4809 | 4806 | | |
4810 | 4807 | | |
4811 | 4808 | | |
4812 | | - | |
4813 | | - | |
| 4809 | + | |
| 4810 | + | |
| 4811 | + | |
4814 | 4812 | | |
4815 | | - | |
4816 | 4813 | | |
4817 | 4814 | | |
4818 | 4815 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
781 | 782 | | |
782 | 783 | | |
783 | 784 | | |
784 | | - | |
| 785 | + | |
785 | 786 | | |
786 | | - | |
| 787 | + | |
787 | 788 | | |
788 | 789 | | |
789 | 790 | | |
| |||
806 | 807 | | |
807 | 808 | | |
808 | 809 | | |
809 | | - | |
| 810 | + | |
810 | 811 | | |
811 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
812 | 820 | | |
813 | 821 | | |
814 | 822 | | |
815 | 823 | | |
816 | 824 | | |
817 | 825 | | |
818 | 826 | | |
819 | | - | |
| 827 | + | |
820 | 828 | | |
821 | 829 | | |
822 | 830 | | |
823 | 831 | | |
824 | | - | |
| 832 | + | |
825 | 833 | | |
826 | 834 | | |
827 | 835 | | |
| |||
854 | 862 | | |
855 | 863 | | |
856 | 864 | | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
| |||
0 commit comments