Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

stream.readFloat16 should use little endian representation #2445

Open
demurgos opened this issue Apr 29, 2018 · 1 comment
Open

stream.readFloat16 should use little endian representation #2445

demurgos opened this issue Apr 29, 2018 · 1 comment

Comments

@demurgos
Copy link

I think that there is an issue with readFloat16, it uses big endian representation for the underlying bytes instead of little endian.
This is only used for font alignment zone data parsing (which Shumway does not seem to support).

The endianness is not specified, but:

  • Float32 and Float64 are little-endian
  • When testing font alignment parsing zone data parsing on multiple files, little-endian seems to produce better values (between 0.1 and 3) while big-endian returns odd values or even NaN.

var ui16 = this.view.getUint16(this.pos, false);

(the littleEndian should be true instead of false)

@ivanpopelyshev
Copy link

Applied it in my fork, thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants