Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test -c opt ... --test_output=all

- name: Test (Default Build, No Dep Graph)
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test --//:harfbuzz_dep_graph=False ... --test_output=all

check_tests_osx:
name: Check Tests (Mac OS)
runs-on: macos-latest
Expand Down
13 changes: 0 additions & 13 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,3 @@ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")

package(features = ["layering_check"])

bool_flag(
name = "harfbuzz_dep_graph",
build_setting_default = True,
visibility = ["//visibility:public"],
)

config_setting(
name = "use_harfbuzz_dep_graph",
flag_values = {
":harfbuzz_dep_graph": "True",
},
visibility = ["//visibility:public"],
)
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ http_archive(
http_archive(
name = "harfbuzz",
build_file = "//third_party:harfbuzz.BUILD",
integrity = "sha256-L3SwHBRR3Leerxu4zmnOP6nKaZ5rp8fHJSxZ6iiDrIQ=",
strip_prefix = "harfbuzz-d4d4c635217d7e769b66f7d2cb7d528b4a534555",
urls = ["https://github.com/harfbuzz/harfbuzz/archive/d4d4c635217d7e769b66f7d2cb7d528b4a534555.zip"],
strip_prefix = "harfbuzz-c5eda499b4bcc310095b19faec99c9749dabdb52",
integrity = "sha256-4yNdOLuwFK+A9zea2Ykvo1EZbfb+On36/7k7LaXFZYg=",
urls = ["https://github.com/harfbuzz/harfbuzz/archive/c5eda499b4bcc310095b19faec99c9749dabdb52.zip"],
)

# Base 32 Hex
Expand Down
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,6 @@ and run all of the tests:
bazel test ...
```

### Building without Dependency Graph Support

By default this depends on the experimental harfbuzz dependency graph API which isn't yet in mainline harfbuzz.
The dependency graph functionality can be disabled at compile time using the `harfbuzz_dep_graph` build flag.
For example:

```sh
bazel build --//:harfbuzz_dep_graph=False ...
bazel test --//:harfbuzz_dep_graph=False ...
```

Disabling the harfbuzz dependency graph API will cause segmenter runs using the `CLOSURE_AND_DEP_GRAPH` and `CLOSURE_AND_VALIDATE_DEP_GRAPH` condition analysis modes to fail.

## Producing IFT Encoded Fonts

This project provides command line utilities and a C++ API which can be used to produce IFT encoded
Expand Down
4 changes: 0 additions & 4 deletions ift/config/auto_segmenter_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -602,15 +602,11 @@ static void ApplyQualityLevelTo(Quality quality, SegmenterConfig& config) {

config.set_unmapped_glyph_handling(MOVE_TO_INIT_FONT);

#ifdef HB_DEPEND_API
if (quality == ONE) {
config.set_condition_analysis_mode(DEP_GRAPH_ONLY_WITH_SIMPLIFICATION);
} else {
config.set_condition_analysis_mode(DEP_GRAPH_ONLY);
}
#else
config.set_condition_analysis_mode(CLOSURE_ONLY);
#endif

switch (quality) {
case ONE:
Expand Down
4 changes: 0 additions & 4 deletions ift/config/auto_segmenter_config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ base_segmentation_plan {
}
generate_feature_segments: true
)"
#ifdef HB_DEPEND_API
"condition_analysis_mode: DEP_GRAPH_ONLY\n"
#else
"condition_analysis_mode: CLOSURE_ONLY\n"
#endif
);
}

Expand Down
10 changes: 6 additions & 4 deletions ift/config/segmenter_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import "ift/config/segmentation_plan.proto";
import "ift/config/common.proto";

enum ConditionAnalysisMode {
// [DEPRECATED]
// Analyzes glyph conditions using closure analysis only.
// This is a legacy mode, it's much slower and generally produces
// worse results then the dependency graph approach.
CLOSURE_ONLY = 0;

// Attempts to analyze glyph conditions using a dependency
// graph where possible. When dep graph is expected not to be accurate
// it falls back to closure analysis. This is for many cases much faster
// then pure closure based analysis. However, the dependency
// graph approach is still experimental and may (rarely) produce
// different results than the pure closure analysis approach.
// then pure closure based analysis.
CLOSURE_AND_DEP_GRAPH = 1;

// Always runs both closure and dependency graph analysis, the
Expand All @@ -23,6 +24,7 @@ enum ConditionAnalysisMode {
// graph approach.
CLOSURE_AND_VALIDATE_DEP_GRAPH = 2;

// [RECOMMENDED]
// Analyze glyph conditions using dep graph only. Closure is
// only used at the very end to validate that founds conditions
// meet the glyph closure requirement.
Expand Down Expand Up @@ -148,7 +150,7 @@ message SegmenterConfig {

// Configures the method used to find glyph activation conditions. See the enum
// for more informmation.
ConditionAnalysisMode condition_analysis_mode = 15 [default = CLOSURE_ONLY];
ConditionAnalysisMode condition_analysis_mode = 15 [default = DEP_GRAPH_ONLY];

// next = 16
}
Expand Down
33 changes: 12 additions & 21 deletions ift/dep_graph/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,15 @@ cc_library(

cc_library(
name = "dep_graph",
srcs = select({
"//:use_harfbuzz_dep_graph": [
"dependency_graph.cc",
],
"//conditions:default": [],
}),
hdrs = select({
"//:use_harfbuzz_dep_graph": [
"dependency_graph.h",
"node.h",
"pending_edge.h",
"traversal.h",
],
"//conditions:default": [],
}),
srcs = [
"dependency_graph.cc",
],
hdrs = [
"dependency_graph.h",
"node.h",
"pending_edge.h",
"traversal.h",
],
visibility = [
"//ift/encoder:__pkg__",
],
Expand All @@ -65,12 +59,9 @@ cc_library(
cc_test(
name = "dependency_graph_test",
size = "small",
srcs = select({
"//:use_harfbuzz_dep_graph": [
"dependency_graph_test.cc",
],
"//conditions:default": [],
}),
srcs = [
"dependency_graph_test.cc",
],
data = [
"//ift/common:testdata",
],
Expand Down
Loading
Loading