Closed fschutt closed 3 years ago
I'm not sure I really want is_mark
to be public again. Ideally it would remain an implementation detail. What was your use case for making it public?
Did you have a particular need for making the various types Copy
? Typically I reserve Copy for smaller types (that fit in a register or two) to avoid surprise memcpy
s.
Here are the sizes (in bytes) of some of the types: HeadTable = 56, TableRecord = 16 HheaTable = 22, MaxpTable = 30, MaxpVersion1SubTable = 26
I'm okay with not implementing Copy, but I need them to be at least Clone, because my implementation doesn't store the entire font, it only stores a few tables. So I can either parse the tables again or I could simply clone them from the font provider.
My usecase for is_mark
is that I want to switch the positioning between MarkPlacement
and Placement
. I can make it a function that returns true on MarkPlacement::None
, it's just that I wanted my code to build yesterday evening
My usecase for is_mark is that I want to switch the positioning between
MarkPlacement
andPlacement
.
So after going through the process of adding positioning info to the allsorts-tools
shape command I don't think it's quite this simple: if a mark is attached to a base glyph with Placement::Distance
then the mark also needs to be adjusted by that distance:
I merged a number of these changes manually. I had to drop the derived Debug
and PartialEq
impls on the cmap types as these don't work in Rust 1.38.0 (due to the Box<[u8; 256]>
), which is the minimum version we support. Are these required for your use case?
No, not required, I just added it because it does make things easier for testing. Clone
is the most important trait.
Thanks for mergin.
NOTE: The code for
.map_glyph
is duplicated, which isn't great. I can't create aReadArray<T>
from aVec<T>
, so I can only either duplicate the code or use a macro.