You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the function provided to calculate the checksum of a table, there is a typo. The variable Endptr is defined, but the variable EndPtr is used in the next line.
Also, this function was confusing to me when I first read it. This function operates on a uint32_t array, but fails to mention that the uint32_t units have to be interpreted as big endian. I initially thought that I could interpret a uint8_t pointer array as a uint32_t pointer and run this function, but that obviously does not work because my computer is little endian. I think that it would be helpful to add a note either to the section or to the code that each uint32_t unit is still big endian. The function could also be rewritten to accept a uint8_t pointer:
As with the original function, this one assumes that Table is padded with zeros, but this is always true if the Table pointer is derived directly from the file data.
Description
In the function provided to calculate the checksum of a table, there is a typo. The variable
Endptr
is defined, but the variableEndPtr
is used in the next line.Also, this function was confusing to me when I first read it. This function operates on a uint32_t array, but fails to mention that the uint32_t units have to be interpreted as big endian. I initially thought that I could interpret a uint8_t pointer array as a uint32_t pointer and run this function, but that obviously does not work because my computer is little endian. I think that it would be helpful to add a note either to the section or to the code that each uint32_t unit is still big endian. The function could also be rewritten to accept a uint8_t pointer:
As with the original function, this one assumes that Table is padded with zeros, but this is always true if the Table pointer is derived directly from the file data.
Page URL
https://learn.microsoft.com/en-us/typography/opentype/spec/otff#calculating-checksums
Content source URL
https://github.com/MicrosoftDocs/typography/blob/live/typographydocs/opentype/spec/otff.md
The text was updated successfully, but these errors were encountered: