Page MenuHome

Refactor: BLF Without Kerning Modes
ClosedPublic

Authored by Harley Acheson (harley) on Aug 18 2021, 8:13 PM.

Details

Summary

Simplification of BLF code after removal of kerning modes.


Once "Unfitted" kerning mode is removed in D12231, the following are simplifications we can do:

We no longer need BLF_KERNING_VARS macro. _has_kerning is just a wrapper for FT_HAS_KERNING macro, which is only a bit check. _kern_mode is always the same value.

Neither FontBLF or KerningCacheBLF need a kerning_mode member.

Because of above, blf_kerning_step_fast, blf_font_ensure_ascii_kerning, and blf_font_width_to_strlen_glyph_process can all be simplified.

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Aug 18 2021, 8:13 PM
Harley Acheson (harley) created this revision.
Campbell Barton (campbellbarton) requested changes to this revision.EditedAug 19 2021, 12:56 AM

One remaining change could be to include the kerning in the font as font->kerning_caches only ever has a single item.
The struct could be referenced as a pointer for any font that has kerning.

This revision now requires changes to proceed.Aug 19 2021, 12:56 AM

One remaining change could be to include the kerning in the font as font->kerning_caches only ever has a single item.
The struct could be referenced as a pointer for any font that has kerning.

@Campbell Barton (campbellbarton) - Right now I have that in a separate patch since I want to do more than just that with the kerning caches. I don't mind doing just what you ask though and then play with them more later.

I'm mostly wanting https://developer.blender.org/D12231 approved and committed first. I could also put them all together, but in total it is a mess of changes and these three patches are quite atomic.

This revision is now accepted and ready to land.Aug 19 2021, 4:11 AM

Updating to current state of master.

This revision was automatically updated to reflect the committed changes.