fontations icon indicating copy to clipboard operation
fontations copied to clipboard

[read-fonts] Hook up cmap format13 subtables

Open behdad opened this issue 9 months ago • 0 comments

Currently only format4 / format12 are hooked up:

    pub fn map_codepoint(&self, codepoint: impl Into<u32>) -> Option<GlyphId> {
        let codepoint = codepoint.into();
        for record in self.encoding_records() {
            if let Ok(subtable) = record.subtable(self.offset_data()) {
                if let Some(gid) = match subtable {
                    CmapSubtable::Format4(format4) => format4.map_codepoint(codepoint),
                    CmapSubtable::Format12(format12) => format12.map_codepoint(codepoint),
                    _ => None,
                } {
                    return Some(gid);
                }
            }
        }
        None
    }

behdad avatar Mar 22 '25 19:03 behdad