Commit f7569d1
committed
truetype/HeadTable: Make TrueType date calculations UTC-based
The TrueType epoch is supposed to be understood as an UTC date.
Instanciating `GregorianCalendar` with a date implicitly sets its
timezone to the local timezone.
Because it is not possible to pass both a date and a timezone to the
constructor of `GregorianCalendar`, let's store the offset as a
precalculated number (`date --date="1904-01-01 00:00:00 UTC" +%s`).
While we are at it, let's also switch from negative- to
positive-offsent calculations.1 parent 67f7596 commit f7569d1
File tree
1 file changed
+7
-7
lines changed- main/java/BitsNPicas/src/com/kreative/bitsnpicas/truetype
1 file changed
+7
-7
lines changedLines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
| 94 | + | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
0 commit comments