maplibre/legacy/
font_stack.rs1use std::collections::BTreeSet;
4
5use crate::{legacy::util::hash_combine, style::layer::StyleLayer};
6
7pub type FontStack = Vec<String>;
10pub type FontStackHash = u64;
12
13pub struct FontStackHasher;
15
16impl FontStackHasher {
17 pub fn new(font_stack: &FontStack) -> u64 {
19 let mut seed = 0;
20 for font in font_stack {
21 hash_combine(&mut seed, font);
22 }
23 seed
24 }
25}
26
27pub fn font_stack_to_string(font_stack: &FontStack) -> String {
29 font_stack.join(",")
30}
31
32pub fn font_stacks(layers: &Vec<StyleLayer>) -> BTreeSet<FontStack> {
35 let mut result = BTreeSet::new();
36 for layer in layers {
37 populate_font_stack(layer, &mut result);
38 }
39
40 result
41}
42
43pub(crate) fn populate_font_stack(layer: &StyleLayer, stack: &mut BTreeSet<FontStack>) {
45 todo!()
46}