maplibre/legacy/glyph_range.rs
1//! Translated from https://github.com/maplibre/maplibre-native/blob/4add9ea/include/mbgl/text/glyph_range.hpp
2
3use std::ops::Range;
4
5use crate::legacy::util::hash;
6
7/// maplibre/maplibre-native#4add9ea original name: GlyphRange
8pub type GlyphRange = Range<u16>;
9
10const GLYPHS_PER_GLYPH_RANGE: u32 = 256;
11const GLYPH_RANGES_PER_FONT_STACK: u32 = 256;
12// 256 - 126 ranges skipped w/ i18n::allowsFixedWidthGlyphGeneration
13const NON_IDEOGRAPH_GLYPH_RANGES_PER_FONT_STACK: u32 = 130;
14
15/// maplibre/maplibre-native#4add9ea original name: hash_glyphrange
16fn hash_glyphrange(range: &GlyphRange) -> u64 {
17 hash(&[range.start, range.end])
18}