feat(api)!: TextStyle::font_name is a string of its own - #900
Merged
Merged
Conversation
The `std::string_view` borrowed from the document that produced the style, so a style could not outlive its document and a caller could not build one with a font name, which `Text::set_style` made a real gap. It is a `std::string` now. The `.doc` and `.ppt` registries stop carrying the font names for lifetime alone, the python style getters drop the keep-alive they needed only for it, and the Java and Objective-C converters pass a font name through to C++, which refuses it as before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137vd79NGaB8nfLsdPoghM4
andiwand
force-pushed
the
feat/font-name-string
branch
from
September 13, 2026 17:56
7d7c74c to
7957aac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
The second of the three public-API changes before the major. Independent of the other two.
The change.
TextStyle::font_namewas astd::optional<std::string_view>borrowing from the document that produced the style. A style could not outlive its document, and since #895 madeTextStylean input toText::set_style, a caller could not build one with a font name safely. It is astd::optional<std::string>now.What follows from it.
.docand.pptstyle registries carried the font names only to keep the views alive; they take the resolved styles alone now. The.xlsregistry keeps its fonts, which the XF records index.font_nameis a plain read-write property.Text::set_stylerefuses it as before, and the Swift test that expects that still passes.string_viewoverload goes, having no caller left.Verified. 908 tests across the document, html, legacy MS, markdown, odf and ooxml suites pass, with the C++ refusal of a font name pinned in
document_edit_test. Every html output page is byte-identical to the reference in both corpora. JUnit 63 and pytest 83 pass, python sets and reads a font name, and the macOS Apple slice built for both archs withswift testpassing. The thirteen touched translation units are clean under Homebrew clang-Wall -Wextra -Werror.Changelog entry added, marked breaking.