oficina / docs Public

Drop the font manifest's unread Twin field

Comments and a test said Twin stayed "for DOCX export and paste", but
nothing in Go read it: export and paste name the Word face through
docx.name, which TestDocxNames already holds. The test's twin count
guarded nothing. "twin" stays in fonts.json, which the Apple kit
decodes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev c650a2c8cd2beff6f47cb2e192cc428dbbb61f6f parent 656e961
3 files changed, +6 −18
  • internal/docs/export.go +2 −2
  • internal/docs/export_test.go +3 −11
  • internal/fonts/fonts.go +1 −5

CI passed — run details

diff --git a/internal/docs/export.go b/internal/docs/export.go
index 24c5d65..674bd64 100644
--- a/internal/docs/export.go
+++ b/internal/docs/export.go
@@ -162,8 +162,8 @@ func sizeOptions() []toolbarOption {
// row and on the closed box (data-rst-class, rastrillo v0.28.0). The
// name is the family's own, untranslated; it is a proper noun, and the
// preview subset holds exactly its glyphs. A row is the name alone: a
-// Word font's metric twin does not say so (Paul, 2026-10-26); Twin stays
-// in the manifest for DOCX export and paste.
+// Word font's metric twin does not say so (Paul, 2026-10-26). DOCX export
+// and paste name the Word face through the manifest's docx.name.
type fontOption struct {
Value string
Name string
diff --git a/internal/docs/export_test.go b/internal/docs/export_test.go
index c177ff2..7cca92f 100644
--- a/internal/docs/export_test.go
+++ b/internal/docs/export_test.go
@@ -793,8 +793,9 @@ func TestEachPickerEntryIsInItsOwnFace(t *testing.T) {
}
// No entry says whose metrics it has (Paul, 2026-10-26: "We don't need
// to mention the compatibility"): no description for ui/select.js to
- // draw, and no copy for one. The twins are still twins, for DOCX
- // export and paste; only the picker stops saying so.
+ // draw, and no copy for one. Only the picker stops saying so: DOCX
+ // export and paste still write and read the Word name, docx.name
+ // (internal/fonts' TestDocxNames holds that).
sel := regexp.MustCompile(`(?s)<select[^>]*id="docs-select-font".*?</select>`).FindString(body)
if sel == "" {
t.Fatal("no font control")
@@ -805,15 +806,6 @@ func TestEachPickerEntryIsInItsOwnFace(t *testing.T) {
if _, ok := Catalog["docs.editor.toolbar.font.compatible"]; ok {
t.Error("the catalog still carries the compatibility copy")
}
- twins := 0
- for _, f := range fonts.Families {
- if f.Twin != "" {
- twins++
- }
- }
- if twins == 0 {
- t.Error("the manifest lost its metric twins; DOCX export and paste still need them")
- }
}
// Every face the stylesheet declares must be a face the app serves,
diff --git a/internal/fonts/fonts.go b/internal/fonts/fonts.go
index bc47dac..dd967af 100644
--- a/internal/fonts/fonts.go
+++ b/internal/fonts/fonts.go
@@ -114,9 +114,6 @@ type Family struct {
Key string
Name string
Category string
- // Twin is the proprietary face this one is metric-compatible with,
- // if any (Carlito: Calibri).
- Twin string
// Reserved is the OFL Reserved Font Name, if the licence has one.
// Such a family is vendored from its authors' files unchanged.
Reserved string
@@ -256,7 +253,6 @@ type manifest struct {
Key string `json:"key"`
Name string `json:"name"`
Category string `json:"category"`
- Twin string `json:"twin"`
Reserved string `json:"reserved"`
Docx Docx `json:"docx"`
Fallback []string `json:"fallback"`
@@ -273,7 +269,7 @@ func init() {
}
for i, mf := range m.Families {
f := &Family{
- Key: mf.Key, Name: mf.Name, Category: mf.Category, Twin: mf.Twin,
+ Key: mf.Key, Name: mf.Name, Category: mf.Category,
Reserved: mf.Reserved, Docx: mf.Docx, Fallback: mf.Fallback, Index: i + 1,
}
if byKey[f.Key] != nil {