mapbox / node-fontnik

Fonts ⇢ protobuf-encoded SDF glyphs
BSD 3-Clause "New" or "Revised" License
223 stars 65 forks source link

Bitmaps Getting Cut Off #90

Open mattdesl opened 9 years ago

mattdesl commented 9 years ago

Sorry to keep spamming your inboxes. :smile:

I've noticed some artifacts during rendering with the fontnik bitmaps that don't appear with SDFs generated by Hiero. Here is a side-by-side:

fontnik2

I'm guessing the artifacts while rendering may be due to the SDF tiles getting cut off.

Is there some implementation detail that I'm missing?

mattdesl commented 9 years ago

Tried building from source and changing the buffer size. It stops getting cut-off but leads to no improvement in the artifacts. :disappointed:

mikemorris commented 9 years ago

Was about to suggest that @mattdesl, I think this could be caused by some of the hardcoded defaults mentioned in https://github.com/mapbox/node-fontnik/issues/51

mikemorris commented 9 years ago

Possible the cutoff is happening as a combination of the buffer and cutoff values?

// Shift the 0 so that we can fit a few negative values
// into our 8 bits.

Bumping up the SDF size may help alleviate some rendering artifacts, as illustrated in https://github.com/mapbox/node-fontnik/issues/38