feat(sheets): support font_family in cell styles#1549
Open
zhengzhijiej-tech wants to merge 1 commit into
Open
Conversation
Add a font_family field to cell_styles so a cell's font name can be set and read back through every style entry point: - +cells-set (--cells JSON) and +cells-set-style / +cells-batch-set-style gain a font_family field / --font-family flat flag - +workbook-create / +table-put --styles accept font_family in cell_styles - +cells-get returns font_family helpers.go buildCellStyleFromFlags reads the --font-family flag; lark_sheet_workbook.go allows font_family in the --styles cell_styles whitelist; data/ + skills/ are synced from sheet-skill-spec.
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.
What
Add a
font_familyfield tocell_stylesso a cell's font name (e.g.Arial,Microsoft YaHei) can be set and read back. Until nowcell_stylessupported font size / weight / style / color / line but not the font family itself.Coverage
font_family flows through every entry point that sets a cell style:
+cells-set(--cellsJSON) — passes through toset_cell_range+cells-set-style/+cells-batch-set-style— new--font-familyflat flag+workbook-create/+table-put(--styles) —font_familyallowed in cell_styles+cells-getreturnsfont_familyChanges
shortcuts/sheets/helpers.go:buildCellStyleFromFlagsreads the--font-familyflagshortcuts/sheets/lark_sheet_workbook.go: allowfont_familyin the--stylescell_styles field whitelistshortcuts/sheets/data/{flag-defs,flag-schemas}.json+skills/lark-sheets/references/*: synced from the spec (font_family in schema + docs)flag_defs_gen.go: regeneratedThe backend (
set_cell_range/get_cell_ranges) reads/writes the font name on the in-memory style model; this PR is the CLI surface.Test
go test ./shortcuts/sheets/...green+cells-get, font_family round-trips (English and CJK font names).