Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

feat(text-measure): bundle Segoe UI advances measured from Selawik

hugohe33214e29a5309
diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.md
index 31b2b977..11b0aa8f 100644
--- a/skills/ppt-master/scripts/docs/svg-pipeline.md
+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md
@@ -1069,10 +1069,13 @@ Requirements:
`text_measure.py` imports the same single-line DrawingML width estimator used by
the SVG quality checker.
-Use Arial, Times New Roman, Georgia, Verdana, or Calibri for bundled per-glyph
-advance measurements from `svg_to_pptx/drawingml/font_advances.json` in regular,
-bold, italic, and bold-italic styles. Expect other families to keep the
-class-average estimate, with the existing fixed advances for monospaced faces.
+Use Arial, Times New Roman, Georgia, Verdana, Calibri, Cambria, Trebuchet MS, or
+Garamond for bundled per-glyph advance measurements from
+`svg_to_pptx/drawingml/font_advances.json` in regular, bold, italic, and
+bold-italic styles; Tahoma and Segoe UI carry regular and bold only (Segoe UI is
+measured from Selawik, Microsoft's OFL metric-compatible replacement). Expect a
+missing style or another family to keep the class-average estimate, with the
+existing fixed advances for monospaced faces.
- `measure` prints one `width<TAB>text` line per input, or a JSON array with
`--json`.
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/font_advances.json b/skills/ppt-master/scripts/svg_to_pptx/drawingml/font_advances.json
index db895c2a..3faefcaa 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/font_advances.json
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/font_advances.json
@@ -7907,6 +7907,430 @@
"≥": 0.5488
}
}
+},
+"segoe ui": {
+"regular": {
+"face": "Selawik Regular (Microsoft's OFL metric-compatible replacement for Segoe UI)",
+"advances": {
+" ": 0.2739,
+"!": 0.2842,
+"\"": 0.3921,
+"#": 0.5908,
+"$": 0.5391,
+"%": 0.8184,
+"&": 0.8003,
+"'": 0.23,
+"(": 0.3018,
+")": 0.3018,
+"*": 0.417,
+"+": 0.6841,
+",": 0.2168,
+"-": 0.3999,
+".": 0.2168,
+"/": 0.3897,
+"0": 0.5391,
+"1": 0.5391,
+"2": 0.5391,
+"3": 0.5391,
+"4": 0.5391,
+"5": 0.5391,
+"6": 0.5391,
+"7": 0.5391,
+"8": 0.5391,
+"9": 0.5391,
+":": 0.2168,
+";": 0.2168,
+"<": 0.6841,
+"=": 0.6841,
+">": 0.6841,
+"?": 0.4482,
+"@": 0.9551,
+"A": 0.645,
+"B": 0.5733,
+"C": 0.6191,
+"D": 0.7012,
+"E": 0.5059,
+"F": 0.4883,
+"G": 0.686,
+"H": 0.71,
+"I": 0.2661,
+"J": 0.3569,
+"K": 0.5801,
+"L": 0.4707,
+"M": 0.898,
+"N": 0.748,
+"O": 0.7539,
+"P": 0.5601,
+"Q": 0.7539,
+"R": 0.5981,
+"S": 0.5312,
+"T": 0.5239,
+"U": 0.687,
+"V": 0.6211,
+"W": 0.9341,
+"X": 0.5898,
+"Y": 0.5527,
+"Z": 0.5703,
+"[": 0.3018,
+"\\": 0.3789,
+"]": 0.3018,
+"^": 0.6841,
+"_": 0.415,
+"`": 0.2681,
+"a": 0.5088,
+"b": 0.5879,
+"c": 0.4619,
+"d": 0.5889,
+"e": 0.523,
+"f": 0.313,
+"g": 0.5889,
+"h": 0.5659,
+"i": 0.2422,
+"j": 0.2422,
+"k": 0.4971,
+"l": 0.2422,
+"m": 0.8613,
+"n": 0.5659,
+"o": 0.5859,
+"p": 0.5879,
+"q": 0.5889,
+"r": 0.3477,
+"s": 0.4243,
+"t": 0.3389,
+"u": 0.5659,
+"v": 0.479,
+"w": 0.7227,
+"x": 0.459,
+"y": 0.4839,
+"z": 0.4522,
+"{": 0.3018,
+"|": 0.2393,
+"}": 0.3018,
+"~": 0.6841,
+"¡": 0.2842,
+"¢": 0.5391,
+"£": 0.5391,
+"¤": 0.5557,
+"¥": 0.5391,
+"¦": 0.2393,
+"§": 0.4482,
+"¨": 0.4141,
+"©": 0.8901,
+"«": 0.5059,
+"¬": 0.6841,
+"­": 0.0,
+"®": 0.8901,
+"¯": 0.415,
+"°": 0.377,
+"±": 0.6841,
+"²": 0.3662,
+"³": 0.3662,
+"´": 0.2822,
+"µ": 0.5772,
+"¶": 0.458,
+"·": 0.2168,
+"¸": 0.2051,
+"¹": 0.3511,
+"»": 0.5059,
+"¼": 0.9062,
+"½": 0.9307,
+"¾": 0.9522,
+"¿": 0.4482,
+"À": 0.645,
+"Á": 0.645,
+"Â": 0.645,
+"Ã": 0.645,
+"Ä": 0.645,
+"Å": 0.645,
+"Æ": 0.8604,
+"Ç": 0.6191,
+"È": 0.5059,
+"É": 0.5059,
+"Ê": 0.5059,
+"Ë": 0.5059,
+"Ì": 0.2661,
+"Í": 0.2661,
+"Î": 0.2661,
+"Ï": 0.2661,
+"Ð": 0.7012,
+"Ñ": 0.748,
+"Ò": 0.7539,
+"Ó": 0.7539,
+"Ô": 0.7539,
+"Õ": 0.7539,
+"Ö": 0.7539,
+"×": 0.6841,
+"Ø": 0.7539,
+"Ù": 0.687,
+"Ú": 0.687,
+"Û": 0.687,
+"Ü": 0.687,
+"Ý": 0.5527,
+"Þ": 0.5601,
+"ß": 0.544,
+"à": 0.5088,
+"á": 0.5088,
+"â": 0.5088,
+"ã": 0.5088,
+"ä": 0.5088,
+"å": 0.5088,
+"æ": 0.832,
+"ç": 0.4619,
+"è": 0.523,
+"é": 0.523,
+"ê": 0.523,
+"ë": 0.523,
+"ì": 0.2422,
+"í": 0.2422,
+"î": 0.2422,
+"ï": 0.2422,
+"ð": 0.5591,
+"ñ": 0.5659,
+"ò": 0.5859,
+"ó": 0.5859,
+"ô": 0.5859,
+"õ": 0.5859,
+"ö": 0.5859,
+"÷": 0.6841,
+"ø": 0.5859,
+"ù": 0.5659,
+"ú": 0.5659,
+"û": 0.5659,
+"ü": 0.5659,
+"ý": 0.4839,
+"þ": 0.5879,
+"ÿ": 0.4839,
+"–": 0.5,
+"—": 1.0,
+"‘": 0.229,
+"’": 0.229,
+"‚": 0.229,
+"“": 0.377,
+"”": 0.377,
+"„": 0.377,
+"†": 0.375,
+"‡": 0.375,
+"•": 0.4062,
+"…": 0.7329,
+"‰": 1.21,
+"‹": 0.3159,
+"›": 0.3159,
+"€": 0.5391,
+"™": 0.773,
+" ": 0.2739
+}
+},
+"bold": {
+"face": "Selawik Bold (Microsoft's OFL metric-compatible replacement for Segoe UI)",
+"advances": {
+" ": 0.2759,
+"!": 0.3272,
+"\"": 0.4932,
+"#": 0.5923,
+"$": 0.5752,
+"%": 0.8672,
+"&": 0.8496,
+"'": 0.293,
+"(": 0.3691,
+")": 0.3691,
+"*": 0.4551,
+"+": 0.707,
+",": 0.271,
+"-": 0.4043,
+".": 0.271,
+"/": 0.4434,
+"0": 0.5752,
+"1": 0.5752,
+"2": 0.5752,
+"3": 0.5752,
+"4": 0.5752,
+"5": 0.5752,
+"6": 0.5752,
+"7": 0.5752,
+"8": 0.5752,
+"9": 0.5752,
+":": 0.271,
+";": 0.271,
+"<": 0.707,
+"=": 0.707,
+">": 0.707,
+"?": 0.438,
+"@": 0.9541,
+"A": 0.7031,
+"B": 0.6411,
+"C": 0.624,
+"D": 0.7373,
+"E": 0.5322,
+"F": 0.52,
+"G": 0.7109,
+"H": 0.7661,
+"I": 0.3169,
+"J": 0.4453,
+"K": 0.6489,
+"L": 0.5112,
+"M": 0.957,
+"N": 0.79,
+"O": 0.7583,
+"P": 0.6143,
+"Q": 0.7583,
+"R": 0.6528,
+"S": 0.5605,
+"T": 0.5859,
+"U": 0.7231,
+"V": 0.667,
+"W": 1.0049,
+"X": 0.6553,
+"Y": 0.6069,
+"Z": 0.6069,
+"[": 0.3691,
+"\\": 0.436,
+"]": 0.3691,
+"^": 0.707,
+"_": 0.415,
+"`": 0.314,
+"a": 0.5381,
+"b": 0.6201,
+"c": 0.48,
+"d": 0.6191,
+"e": 0.541,
+"f": 0.3833,
+"g": 0.6191,
+"h": 0.602,
+"i": 0.2842,
+"j": 0.2842,
+"k": 0.5591,
+"l": 0.2842,
+"m": 0.916,
+"n": 0.605,
+"o": 0.6113,
+"p": 0.6201,
+"q": 0.6191,
+"r": 0.398,
+"s": 0.4399,
+"t": 0.3892,
+"u": 0.605,
+"v": 0.542,
+"w": 0.7974,
+"x": 0.5523,
+"y": 0.5381,
+"z": 0.479,
+"{": 0.3691,
+"|": 0.3262,
+"}": 0.3691,
+"~": 0.707,
+"¡": 0.3272,
+"¢": 0.5752,
+"£": 0.5752,
+"¤": 0.5562,
+"¥": 0.5752,
+"¦": 0.3262,
+"§": 0.4854,
+"¨": 0.4619,
+"©": 0.874,
+"«": 0.5811,
+"¬": 0.707,
+"­": 0.0,
+"®": 0.874,
+"¯": 0.415,
+"°": 0.3799,
+"±": 0.707,
+"²": 0.4043,
+"³": 0.4043,
+"´": 0.3032,
+"µ": 0.6128,
+"¶": 0.5093,
+"·": 0.271,
+"¸": 0.2153,
+"¹": 0.394,
+"»": 0.5811,
+"¼": 0.9522,
+"½": 0.9653,
+"¾": 0.979,
+"¿": 0.438,
+"À": 0.7031,
+"Á": 0.7031,
+"Â": 0.7031,
+"Ã": 0.7031,
+"Ä": 0.7031,
+"Å": 0.7031,
+"Æ": 0.9351,
+"Ç": 0.624,
+"È": 0.5322,
+"É": 0.5322,
+"Ê": 0.5322,
+"Ë": 0.5322,
+"Ì": 0.3169,
+"Í": 0.3169,
+"Î": 0.3169,
+"Ï": 0.3169,
+"Ð": 0.7373,
+"Ñ": 0.79,
+"Ò": 0.7578,
+"Ó": 0.7578,
+"Ô": 0.7578,
+"Õ": 0.7578,
+"Ö": 0.7578,
+"×": 0.707,
+"Ø": 0.7583,
+"Ù": 0.7231,
+"Ú": 0.7231,
+"Û": 0.7231,
+"Ü": 0.7231,
+"Ý": 0.6069,
+"Þ": 0.6143,
+"ß": 0.6279,
+"à": 0.5381,
+"á": 0.5381,
+"â": 0.5381,
+"ã": 0.5381,
+"ä": 0.5381,
+"å": 0.5381,
+"æ": 0.8281,
+"ç": 0.48,
+"è": 0.541,
+"é": 0.541,
+"ê": 0.541,
+"ë": 0.541,
+"ì": 0.2842,
+"í": 0.2842,
+"î": 0.2842,
+"ï": 0.2842,
+"ð": 0.5933,
+"ñ": 0.605,
+"ò": 0.6108,
+"ó": 0.6108,
+"ô": 0.6108,
+"õ": 0.6108,
+"ö": 0.6104,
+"÷": 0.707,
+"ø": 0.6113,
+"ù": 0.605,
+"ú": 0.605,
+"û": 0.605,
+"ü": 0.605,
+"ý": 0.5381,
+"þ": 0.6201,
+"ÿ": 0.5381,
+"–": 0.5,
+"—": 1.0,
+"‘": 0.29,
+"’": 0.29,
+"‚": 0.29,
+"“": 0.4932,
+"”": 0.4932,
+"„": 0.4932,
+"†": 0.4062,
+"‡": 0.4062,
+"•": 0.4224,
+"…": 0.9121,
+"‰": 1.2563,
+"‹": 0.3442,
+"›": 0.3442,
+"€": 0.5752,
+"™": 0.771,
+" ": 0.2759
+}
+}
}
}
}
diff --git a/skills/ppt-master/scripts/tests/test_text_measure.py b/skills/ppt-master/scripts/tests/test_text_measure.py
index 6c5aaca9..00b40b71 100644
--- a/skills/ppt-master/scripts/tests/test_text_measure.py
+++ b/skills/ppt-master/scripts/tests/test_text_measure.py
@@ -125,7 +125,7 @@ class TextMeasureTests(unittest.TestCase):
text = 'The dissemination layer covers the poster you stand next to at a conference session'
crude = sum(estimate_text_cluster_widths(text, 16))
self.assertAlmostEqual(crude, 661.6)
- for family in ('Segoe UI', 'Unlisted Sans', 'Segoe UI, Arial'):
+ for family in ('Aptos', 'Unlisted Sans', 'Aptos, Arial'):
with self.subTest(family=family):
self.assertEqual(
measure_text(text, size=16, family=family, include_headroom=False),