Skip to content

Commit 7d2f832

Browse files
committed
Add base_segmentation_plan to segmenter config.
Allows the config to provide segmentation plan settings to include in the output plan.
1 parent 019fec9 commit 7d2f832

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

util/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ proto_library(
4242
"//visibility:public",
4343
],
4444
deps = [
45+
":segmentation_plan_proto",
4546
":common_proto",
4647
],
4748
)

util/closure_glyph_keyed_segmenter_util.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,15 @@ static Status Main(const std::vector<char*> args) {
193193
AddTableKeyedSegments(plan, merge_groups, segments, init_segment);
194194
}
195195

196+
SegmentationPlan combined = config.base_segmentation_plan();
197+
combined.MergeFrom(plan);
198+
196199
// TODO(garretrieger): assign a basic (single segment) table keyed config.
197200
// Later on the input to this util should include information on how the
198201
// segments should be grouped together for the table keyed portion of the
199202
// font.
200203
std::string config_string;
201-
TextFormat::PrintToString(plan, &config_string);
204+
TextFormat::PrintToString(combined, &config_string);
202205
std::cout << config_string;
203206
} else {
204207
// No config requested, just output a simplified plain text representation

util/segmenter_config.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
edition = "2023";
22

3+
import "util/segmentation_plan.proto";
34
import "util/common.proto";
45

56
// This messages provides the configuration details for closure_glyph_keyed_segmenter_util
@@ -100,6 +101,9 @@ message SegmenterConfig {
100101
// Any segments that are not covered by any merge group will not be merged.
101102
// Merge groups are not required to be disjoint and may have overlapping segments.
102103
repeated MergeGroup merge_groups = 12;
104+
105+
// When provide the generated segmentation plan will be merged onto this base plan.
106+
SegmentationPlan base_segmentation_plan = 13;
103107
}
104108

105109
// For a given set of segments this configures how merging will be performed. Each merge group

0 commit comments

Comments
 (0)