New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reaching ttf_parser's face. #13
Comments
Wow! I haven't expected that. Yes, As for the new code, I will look into it later. Also, prefer |
I'm hesitant to merge the logic as is because the FFI is pretty hacky. Basically, I construct the data slices for the subtables from the C++ table's The remaining layout API and the font/face thing could then maybe be a separate PR. |
Yes, the integration part is a complex one. That's why I wanted to implement AAT first, so we could easily break everything while finalizing GSUB/GPOS. I suggest trying to remove AAT completely. Then remove all the C++ code (we have to port I haven't looked at hb source like 5 month, so maybe I'm missing something. But since GSUB/GPOS is the final milestone, I think it's fine to break the code/architecture a bit. |
I think that might not even be necessary. It's definitely a step I would regard as last resort because my experience is that removing and rewriting lots of code at once (i.e. without testing in between) leads to very hard-to-find bugs. I studied the dependencies between the |
I removed the acceleration structures (actually, hb-set is now not used anywhere anymore) and I also removed the subtable shims from GSUB/GPOS. So all lookups now go through a few FFI functions ( You mentioned earlier that you would prefer multiple patches. Do you prefer having a PR with the current code (with the undefined behaviour for invalid fonts) and have the font/face merging and the rest separately or should I continue on my branch? |
Actually, I just realized that I can just get the GSUB data+length this way and pass that through FFI: const char *data = (const char*)face->table.GSUB->table.get_blob();
unsigned int length = face->table.GSUB->table.get_length(); So top-level GSUB/GPOS is not blocked on font/face merging and it should probably be done before the PR to get rid of the undefined behaviour. |
Hmm... Can we use Still, I've already forgot how it all works internally. All I know is that UB is bad, because it's way too easy to trigger it and disabling hb's table caching will decrease the performance. I agree, that slow incremental update is always better. I've already burnt myself way too many times. But this part of hb is so interconnected, that a gradual rewrite becomes almost impossible. |
@RazrFalcon I've ported all the GSUB/GPOS-specific subtables (you can have a look here) and am now thinking about how to port the remaining code in the
hb-ot-layout-*
files. In doing that, I want to use some GDEF-related functions fromttf_parser
. But it turns out thathb-ot-layout.h
andhb-ot-layout.hh
expose a lot of functions, which only takerb_face_t
(and notrb_font_t
). Thettfp_face
, however, is stored in the font and not in the face and thus unreachable.Now, I basically see two options:
ttfp_face
into therb_face_t
(not that easy becauserb_face_t
is still in C++),rb_font_t
and basically don't make the font/face distiction (which rustybuzz currently doesn't do anyway at the API level).What do you think?
(If you have any other comments on the code I've produced so far, feel also free to review a bit.)
The text was updated successfully, but these errors were encountered: