Skip to content
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

Integrate Harffbuzz freetype to render Khmer Burmese and hindi #1439

Open
wants to merge 96 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
3928a28
Use harfbuzz and freetype to shape complex text
alanchenboy Jul 28, 2023
6bc372e
Add bazel build for harfbuzz and freetype
alanchenboy Jul 28, 2023
dad9f68
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 28, 2023
fb0daaa
Update harfbuzz and freetype bazel compiling option.
alanchenboy Aug 1, 2023
85161ff
Add harfbuzz and freetype submodule commit.
alanchenboy Aug 1, 2023
44acffb
Batch compile harfbuzz & freetype
alanchenboy Aug 1, 2023
b1a7450
export hb-ft
alanchenboy Aug 2, 2023
f59f9e2
fix shadow error in glyph request range
alanchenboy Aug 2, 2023
1433890
modernize use using for forward declare harbuzz and freetype object.
alanchenboy Aug 2, 2023
a46fd67
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 2, 2023
56f6a3f
fix resource glyphs ambiguous
alanchenboy Aug 2, 2023
67444cb
Merge branch 'harffbuzzFreetype' of github.com:alanchenboy/maplibre-g…
alanchenboy Aug 2, 2023
4081179
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 2, 2023
eea5a62
bump harbuzz to 5.1.0 to pass qt CI
alanchenboy Aug 2, 2023
73af9f7
Merge branch 'harffbuzzFreetype' of github.com:alanchenboy/maplibre-g…
alanchenboy Aug 2, 2023
3aa4c67
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 2, 2023
b6ada33
fix harfbuzz related unit tests
alanchenboy Aug 3, 2023
3747ca0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 3, 2023
4405016
fix qt build
alanchenboy Aug 3, 2023
8363573
Merge branch 'main' into harffbuzzFreetype
alanchenboy Aug 15, 2023
8bb7c03
Fix change line logic to just use bidi and \n
alanchenboy Aug 17, 2023
b73a881
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 17, 2023
b824068
Fix g++ compiling errors
alanchenboy Aug 18, 2023
f8891fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 18, 2023
4990b00
fix cmake build errors
alanchenboy Aug 18, 2023
be6f572
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 18, 2023
0b09e26
Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks"
alanchenboy Aug 18, 2023
23abced
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 18, 2023
9fe480e
revert "fix cmake build errors"
alanchenboy Aug 18, 2023
cbdbaf2
Merge branch 'harffbuzzFreetype' of github.com:alanchenboy/maplibre-g…
alanchenboy Aug 18, 2023
200e950
remove clang tidy check at mbgl/text
alanchenboy Aug 18, 2023
8a2162b
Merge branch 'main' into harffbuzzFreetype
alanchenboy Aug 24, 2023
43d9cc8
roll back cmake Werror settings
alanchenboy Aug 24, 2023
8571a34
Merge branch 'main' into harffbuzzFreetype
alanchenboy Aug 30, 2023
9fb1ab6
wrap harfbuzz freetype to prevent cl tindy failure
alanchenboy Aug 28, 2023
b8c5d43
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 31, 2023
06ec529
Merge branch 'main' into harffbuzzFreetype
alanchenboy Sep 5, 2023
0808a3f
fix the lacking for vertical punctuations' glyphs.
alanchenboy Sep 5, 2023
e794563
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 5, 2023
b76a842
Merge branch 'main' into harffbuzzFreetype
alanchenboy Sep 5, 2023
8b958b2
Update to metrics related to khmer
alanchenboy Sep 8, 2023
173e1a7
Add bigobj for harfbuzz on windows. split harfbuzzFreetype into 3 p…
alanchenboy Sep 11, 2023
98b62c6
remove mbig-obj for linux
alanchenboy Sep 12, 2023
ddc3cc0
disable bzip2 to compile on linux
alanchenboy Sep 14, 2023
df1b560
Merge branch 'main' into harffbuzzFreetype
alanchenboy Sep 15, 2023
18aa8d0
add burmese khmer devanagari render tests
alanchenboy Sep 18, 2023
bc59310
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 18, 2023
9a8cef1
fix unit test compile errors.
alanchenboy Sep 20, 2023
8e6093d
remove font file in metrics
alanchenboy Sep 20, 2023
17cd957
Merge branch 'main' into harffbuzzFreetype
alanchenboy Oct 10, 2023
6b02cba
add bigobj for harbuzz-subset
alanchenboy Oct 10, 2023
d18219e
Merge branch 'main' into harffbuzzFreetype
alanchenboy Oct 18, 2023
004d6cc
Merge branch 'main' into harffbuzzFreetype
louwers Oct 20, 2023
d79e1d6
Merge branch 'main' into harffbuzzFreetype
louwers Oct 21, 2023
5c91f59
Merge branch 'main' into harffbuzzFreetype
alanchenboy Oct 25, 2023
2db5e04
Add MLN_TEXT_SHAPING_HARFBUZZ to support opt-out harfbuzz freetype, R…
alanchenboy Oct 25, 2023
a5fd2f2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 25, 2023
b6fa78e
fix android and linux compile issues
alanchenboy Oct 26, 2023
a870ca5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 26, 2023
b149c99
fix qt compile issue
alanchenboy Oct 26, 2023
d310dd0
Fix cmake compile issue with harfbuzz
alanchenboy Oct 27, 2023
ba3248b
Merge branch 'main' into harffbuzzFreetype
alanchenboy Oct 27, 2023
619cec1
Merge branch 'main' into harffbuzzFreetype
alanchenboy Oct 30, 2023
a41d1d0
Merge branch 'main' into harffbuzzFreetype
alanchenboy Dec 5, 2023
0ec63db
style base font faces
alanchenboy Dec 8, 2023
4b93968
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 8, 2023
b3189b9
Merge branch 'main' into harffbuzzFreetype
alanchenboy Dec 12, 2023
344b58f
Merge remote-tracking branch 'upstream/main' into harffbuzzFreetype
louwers Dec 13, 2023
41c01a3
Enable MLN_TEXT_SHAPING_HARFBUZZ
louwers Dec 13, 2023
abcd3f7
Merge branch 'main' into harffbuzzFreetype
alanchenboy Jan 18, 2024
f3526be
Fix shaping result index mismatch after trim.
alanchenboy Jan 18, 2024
e5845d6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 18, 2024
2d63b4b
Use harfbuzz as default text shaping engine
alanchenboy Jan 25, 2024
4856626
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 25, 2024
3dde156
Compile unit tests
alanchenboy Feb 19, 2024
cfb7fd1
remove GlyphTypeWrap
alanchenboy Feb 19, 2024
19ed817
fix bazel ios_test
alanchenboy Feb 19, 2024
9c8f37b
Merge branch 'main' into harffbuzzFreetype
alanchenboy Feb 19, 2024
d77174c
Fix Linux bazel build
alanchenboy Feb 20, 2024
de7645d
remove test code
alanchenboy Feb 20, 2024
a123ad7
Add Burmese, Devanagari and Khmer render test
alanchenboy Feb 22, 2024
aa42787
remove harfbuzz/freetype wrap
alanchenboy Feb 27, 2024
4abe052
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 27, 2024
10b1eff
Remove harfbuzz freetype comment
alanchenboy Feb 27, 2024
ad2ef8b
Update cmake license
alanchenboy Feb 27, 2024
aa53525
Merge branch 'main' into harffbuzzFreetype
alanchenboy Mar 5, 2024
2f76cee
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 5, 2024
fc6535a
Merge branch 'main' into harffbuzzFreetype
alanchenboy Mar 7, 2024
a2d61d6
Merge branch 'main' into harffbuzzFreetype
alanchenboy Apr 19, 2024
ca19d05
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 19, 2024
d65c81d
Merge branch 'main' into harffbuzzFreetype
alanchenboy May 22, 2024
8cedf12
Merge main
louwers Feb 5, 2025
ee03478
Merge branch 'main' into harffbuzzFreetype
louwers Feb 5, 2025
10adef0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 5, 2025
e8c0aa2
remove project.pbxproj
louwers Feb 5, 2025
f52b23f
fix license definition harfbuzz.cmake
louwers Feb 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
[submodule "platform/windows/vendor/vcpkg"]
path = platform/windows/vendor/vcpkg
url = https://github.com/microsoft/vcpkg.git
[submodule "vendor/harfbuzzFreetype/freetype"]
path = vendor/freetype
url=https://github.com/freetype/freetype.git
[submodule "vendor/harfbuzzFreetype/harfbuzz"]
path = vendor/harfbuzz
url=https://github.com/harfbuzz/harfbuzz
[submodule "vendor/boost"]
path = vendor/boost
url = https://github.com/maplibre/maplibre-gl-native-boost.git
Expand Down
44 changes: 44 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ load(
"MLN_OPENGL_SOURCE",
"MLN_PRIVATE_GENERATED_STYLE_HEADERS",
"MLN_PUBLIC_GENERATED_STYLE_HEADERS",
"MLN_SHAPING_HARFBUZZ_SRCS",
)
load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS")

Expand Down Expand Up @@ -79,6 +80,9 @@ cc_library(
":legacy_renderer": MLN_OPENGL_SOURCE,
":metal_renderer": MLN_DRAWABLES_SOURCE + MLN_DRAWABLES_MTL_SOURCE,
"//conditions:default": [],
}) + select({
"//:harfbuzz_text_shaping": MLN_SHAPING_HARFBUZZ_SRCS,
"//conditions:default": [],
}),
hdrs = MLN_CORE_HEADERS + select({
":drawable_renderer": MLN_OPENGL_HEADERS + MLN_DRAWABLES_HEADERS + MLN_DRAWABLES_GL_HEADERS,
Expand Down Expand Up @@ -106,6 +110,9 @@ cc_library(
}) + select({
"@platforms//os:ios": ["GLES_SILENCE_DEPRECATION=1"],
"//conditions:default": [],
}) + select({
"//:harfbuzz_text_shaping": ["MLN_TEXT_SHAPING_HARFBUZZ=1"],
"//conditions:default": [],
}),
includes = [
"include",
Expand All @@ -115,6 +122,12 @@ cc_library(
"vendor/metal-cpp",
],
"//conditions:default": [],
}) + select({
"//:harfbuzz_text_shaping": [
"vendor/freetype/include",
"vendor/harfbuzz/src",
],
"//conditions:default": [],
}),
local_defines = [
r"MLN_VERSION_REV=\"standalone\"",
Expand Down Expand Up @@ -148,6 +161,12 @@ cc_library(
"//vendor:metal-cpp",
],
"//conditions:default": [],
}) + select({
":harfbuzz_text_shaping": [
"//vendor:freetype",
"//vendor:harfbuzz",
],
"//conditions:default": [],
}) + select({
":rust": [
"//rustutils:rustutilslib",
Expand Down Expand Up @@ -201,6 +220,31 @@ config_setting(
},
)

# Selects the shaping implementation to utilize in the core

string_flag(
name = "shaping",
build_setting_default = "harfbuzz",
values = [
"legacy",
"harfbuzz",
],
)

config_setting(
name = "harfbuzz_text_shaping",
flag_values = {
":shaping": "harfbuzz",
},
)

config_setting(
name = "legacy_text_shaping",
flag_values = {
":shaping": "legacy",
},
)

bool_flag(
name = "use_rust",
build_setting_default = False,
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ option(MLN_DRAWABLE_RENDERER "Include the drawable rendering pathway" OFF)
option(MLN_USE_UNORDERED_DENSE "Use ankerl dense containers for performance" ON)
option(MLN_USE_TRACY "Enable Tracy instrumentation" OFF)
option(MLN_USE_RUST "Use components in Rust" OFF)
option(MLN_TEXT_SHAPING_HARFBUZZ "Use haffbuzz to shape complex text" ON)

if (MLN_WITH_CLANG_TIDY)
find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
Expand Down Expand Up @@ -1381,6 +1382,8 @@ if(MLN_DRAWABLE_RENDERER)
)
endif()

include(${PROJECT_SOURCE_DIR}/cmake/harfbuzz.cmake)

target_sources(
mbgl-core PRIVATE
${INCLUDE_FILES}
Expand Down Expand Up @@ -1484,6 +1487,7 @@ target_link_libraries(
mbgl-vendor-wagyu
$<$<BOOL:${MLN_WITH_METAL}>:mbgl-vendor-metal-cpp>
$<IF:$<BOOL:${MLN_USE_RUST}>,mbgl-rustutils,mbgl-vendor-csscolorparser>
${SHAPE_TARGETS} # from harfbuzz.cmake
PUBLIC
Mapbox::Base
Mapbox::Base::Extras::expected-lite
Expand Down Expand Up @@ -1523,6 +1527,7 @@ set(EXPORT_TARGETS
mbgl-vendor-wagyu
mbgl-vendor-metal-cpp
unordered_dense
${SHAPE_TARGETS} # from harfbuzz.cmake
)

if(MLN_USE_RUST)
Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ bazel_dep(name = "rules_xcodeproj", version = "2.10.0")
bazel_dep(name = "aspect_rules_js", version = "2.1.0")
bazel_dep(name = "rules_nodejs", version = "6.3.2")
bazel_dep(name = "libuv", version = "1.48.0")
bazel_dep(name = "rules_foreign_cc", version = "0.9.0")

node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(node_version = "20.14.0")
Expand Down
9 changes: 9 additions & 0 deletions bazel/core.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ MLN_CORE_SOURCE = [
"src/mbgl/text/shaping.hpp",
"src/mbgl/text/tagged_string.cpp",
"src/mbgl/text/tagged_string.hpp",
"src/mbgl/text/harfbuzz.cpp",
"src/mbgl/text/harfbuzz.hpp",
"src/mbgl/tile/custom_geometry_tile.cpp",
"src/mbgl/tile/custom_geometry_tile.hpp",
"src/mbgl/tile/geojson_tile.cpp",
Expand Down Expand Up @@ -1136,3 +1138,10 @@ MLN_DRAWABLES_MTL_HEADERS = [
"include/mbgl/style/layers/mtl/custom_layer_render_parameters.hpp",
"include/mbgl/shaders/mtl/widevector.hpp",
]

MLN_SHAPING_HARFBUZZ_SRCS = [
"src/mbgl/text/freetype.hpp",
"src/mbgl/text/freetype.cpp",
"src/mbgl/text/harfbuzz_impl.hpp",
"src/mbgl/text/harfbuzz_impl.cpp",
]
Empty file added cache-style.db
Empty file.
56 changes: 56 additions & 0 deletions cmake/harfbuzz.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
set(SHAPE_TARGETS, "")
if (MLN_TEXT_SHAPING_HARFBUZZ)
target_compile_definitions(
mbgl-core
PRIVATE MLN_TEXT_SHAPING_HARFBUZZ=1
)
list(APPEND
SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/text/harfbuzz.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/text/harfbuzz.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/text/harfbuzz_impl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/text/harfbuzz_impl.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/text/freetype.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/text/freetype.hpp
)

set(SHAPE_TARGETS
freetype
harfbuzz
)

set(FT_DISABLE_BROTLI ON CACHE BOOL "freetype option")
set(FT_REQUIRE_BROTLI OFF CACHE BOOL "freetype option")
add_subdirectory(vendor/freetype)
add_subdirectory(vendor/harfbuzz)

target_compile_definitions(harfbuzz PRIVATE -DHAVE_FREETYPE)

set_target_properties(
freetype
PROPERTIES
INTERFACE_MAPLIBRE_NAME "freetype"
INTERFACE_MAPLIBRE_URL "https://github.com/freetype/freetype"
INTERFACE_MAPLIBRE_AUTHOR "David Turner, Robert Wilhelm, Werner Lemberg and FreeType contributors"
INTERFACE_MAPLIBRE_LICENSE ${PROJECT_SOURCE_DIR}/vendor/freetype/docs/FTL.TXT
)

set_target_properties(
harfbuzz
PROPERTIES
INTERFACE_MAPLIBRE_NAME "harfbuzz"
INTERFACE_MAPLIBRE_URL "https://github.com/harfbuzz/harfbuzz"
INTERFACE_MAPLIBRE_AUTHOR ${PROJECT_SOURCE_DIR}/vendor/harfbuzz/AUTHORS
INTERFACE_MAPLIBRE_LICENSE ${PROJECT_SOURCE_DIR}/vendor/harfbuzz/COPYING
)

target_include_directories(
mbgl-core SYSTEM
PUBLIC vendor/freetype/include
)

target_include_directories(
mbgl-core SYSTEM
PUBLIC vendor/harfbuzz/src
)
endif()
1 change: 1 addition & 0 deletions include/mbgl/storage/resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Resource {
static Resource glyphs(const std::string& urlTemplate,
const FontStack& fontStack,
const std::pair<uint16_t, uint16_t>& glyphRange);
static Resource fontFace(const std::string& url);
static Resource spriteImage(const std::string& base, float pixelRatio);
static Resource spriteJSON(const std::string& base, float pixelRatio);
static Resource image(const std::string& url);
Expand Down
69 changes: 65 additions & 4 deletions include/mbgl/text/glyph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,40 @@

namespace mbgl {

using GlyphID = char16_t;
union GlyphID {
char32_t hash;
struct {
char16_t code;
GlyphIDType type;
} complex;

GlyphID(int codepoint) {
complex.type = FontPBF;
complex.code = codepoint;
}
GlyphID(uint32_t codepoint) {
complex.type = FontPBF;
complex.code = codepoint;
}
GlyphID(char16_t codepoint) {
complex.type = FontPBF;
complex.code = codepoint;
}

GlyphID(char16_t index, GlyphIDType t) {
complex.type = t;
complex.code = index;
}

operator char16_t() { return complex.code; }
operator char32_t() { return hash; }
bool operator<(const GlyphID &other) const { return hash < other.hash; }
bool operator>(const GlyphID &other) const { return hash > other.hash; }

bool operator<(const uint16_t &other) const { return hash < other; }
bool operator>(const uint16_t &other) const { return hash > other; }
};

using GlyphIDs = std::set<GlyphID>;

// Note: this only works for the BMP
Expand All @@ -31,7 +64,7 @@ struct GlyphMetrics {
uint32_t advance = 0;
};

inline bool operator==(const GlyphMetrics& lhs, const GlyphMetrics& rhs) {
inline bool operator==(const GlyphMetrics &lhs, const GlyphMetrics &rhs) {
return lhs.width == rhs.width && lhs.height == rhs.height && lhs.left == rhs.left && lhs.top == rhs.top &&
lhs.advance == rhs.advance;
}
Expand Down Expand Up @@ -113,7 +146,7 @@ class Shaping {
float right = 0;
WritingModeType writingMode;
explicit operator bool() const {
return std::any_of(positionedLines.begin(), positionedLines.end(), [](const auto& line) {
return std::any_of(positionedLines.begin(), positionedLines.end(), [](const auto &line) {
return !line.positionedGlyphs.empty();
});
}
Expand All @@ -129,7 +162,35 @@ enum class WritingModeType : uint8_t {
Vertical = 1 << 1,
};

using GlyphDependencies = std::map<FontStack, GlyphIDs>;
// style defined faces
struct FontFace {
GlyphIDType type; // a unique glyph id

FontStack fontStack; // font stack
std::string url; // font file url
std::vector<std::pair<uint32_t, uint32_t>> ranges; // unicode ranges
};

using FontFaces = std::vector<FontFace>;

struct HBShapeRequest {
std::u16string str;
FontStack fontStack;
GlyphIDType type;

HBShapeRequest(const std::u16string &str_, const FontStack &fontStack_, GlyphIDType type_)
: str(str_),
fontStack(fontStack_),
type(type_) {}
};

using HBShapeRequests = std::map<FontStack, std::map<GlyphIDType, std::set<std::u16string>>>;

struct GlyphDependencies {
std::map<FontStack, GlyphIDs> glyphs;
HBShapeRequests shapes;
};

using GlyphRangeDependencies = std::map<FontStack, std::unordered_set<GlyphRange>>;

} // end namespace mbgl
24 changes: 22 additions & 2 deletions include/mbgl/text/glyph_range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,30 @@
#include <cstdint>
#include <unordered_set>
#include <mbgl/util/hash.hpp>
#include <mbgl/util/font_stack.hpp>

namespace mbgl {

using GlyphRange = std::pair<uint16_t, uint16_t>;
enum GlyphIDType : uint16_t {
FontPBF = 0x00,
};

GlyphIDType genNewGlyphIDType(const std::string &url,
const FontStack &fontStack,
const std::vector<std::pair<uint32_t, uint32_t>> &pairs);

class GlyphRange {
public:
uint16_t first = 0;
uint16_t second = 0;

GlyphIDType type = GlyphIDType::FontPBF;

GlyphRange(uint32_t first_, uint32_t second_, GlyphIDType type_);

bool operator==(const GlyphRange &other) const;
bool operator<(const GlyphRange &other) const;
};

constexpr uint32_t GLYPHS_PER_GLYPH_RANGE = 256;
constexpr uint32_t GLYPH_RANGES_PER_FONT_STACK = 256;
Expand All @@ -20,7 +40,7 @@ namespace std {

template <>
struct hash<mbgl::GlyphRange> {
std::size_t operator()(const mbgl::GlyphRange& range) const { return mbgl::util::hash(range.first, range.second); }
std::size_t operator()(const mbgl::GlyphRange &range) const { return mbgl::util::hash(range.first, range.second); }
};

} // namespace std
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"network": [
[
"probeNetwork - default - end",
4,
596680
],
[
"probeNetwork - default - start",
0,
0
]
],
"gfx": [
[
"probeGFX - default - end",
1,
13,
9,
1,
[
364011,
364011
],
[
90850,
90850
],
[
1211104,
1211104
]
]
]
}
Loading
Loading