Skip to content

DYN-10382 - Cherry-pick multi-font and bold/italic support#13

Merged
jasonstratton merged 2 commits into
masterfrom
claude/cherry-pick-multi-font-support
Apr 9, 2026
Merged

DYN-10382 - Cherry-pick multi-font and bold/italic support#13
jasonstratton merged 2 commits into
masterfrom
claude/cherry-pick-multi-font-support

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 9, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Cherry-pick multi-font and bold/italic support from Support-multiple-fonts-and-modernize</issue_title>
<issue_description>## Background

The Support-multiple-fonts-and-modernize branch contains both infrastructure/migration work and new user-facing features. This issue tracks cherry-picking the features only — no project format, build, or CI changes.

Reference branch: Support-multiple-fonts-and-modernize

This issue is assigned to an AI coding agent. Every step below is meant to be executed directly — no design decisions left open.


Files to touch

File Action
Text.cs Add parameters to FromStringOriginAndScale, add GetInstalledFontNames()

No other files. Do not touch .csproj, packages.config, CI, or any build infrastructure.


Checklist

1. Extend FromStringOriginAndScale with font, bold, and italic parameters

Current signature:

public static IEnumerable<Curve> FromStringOriginAndScale(string text, Point origin, double scale)

New signature:

public static IEnumerable<Curve> FromStringOriginAndScale(
    string text,
    Point origin,
    double scale,
    string fontFamily = "Arial",
    bool bold = false,
    bool italic = false)

Implementation requirements:

  • Validate that fontFamily exists in Fonts.SystemFontFamilies. If not found, throw ArgumentException with a message that references GetInstalledFontNames() so the user knows how to discover valid values.
  • Apply font weight: bold ? FontWeights.Bold : FontWeights.Medium
  • Apply font style: italic ? FontStyles.Italic : FontStyles.Normal
  • Default behavior (fontFamily = "Arial", bold = false, italic = false) must be identical to the current method — this is a non-breaking change.

2. Add GetInstalledFontNames() utility method

public static IList<string> GetInstalledFontNames()
  • Query Fonts.SystemFontFamilies, extract the .Source property from each family.
  • Return as an alphabetically sorted IList<string> (case-insensitive sort).
  • No parameters. Windows-only (same as the rest of the library).

3. Add required using statements if missing

  • using System; (for ArgumentException)
  • using System.Linq; (for LINQ queries on SystemFontFamilies)

Definition of done

  • FromStringOriginAndScale accepts fontFamily, bold, and italic — all optional with defaults
  • Calling FromStringOriginAndScale with no new arguments produces identical output to current behavior
  • Passing an uninstalled font name throws ArgumentException with message referencing GetInstalledFontNames()
  • GetInstalledFontNames() returns a non-empty, alphabetically sorted list on Windows
  • No .csproj, CI, NuGet, or build file changes in this PR

Notes

Comments on the Issue (you are @claude[agent] in this section)

@Claude Claude AI linked an issue Apr 9, 2026 that may be closed by this pull request
5 tasks
@johnpierson johnpierson changed the title [WIP] Cherry-pick multi-font and bold/italic support [WIP] DYN-10382 - Cherry-pick multi-font and bold/italic support Apr 9, 2026
@Claude Claude AI requested a review from johnpierson April 9, 2026 20:00
@johnpierson johnpierson changed the title [WIP] DYN-10382 - Cherry-pick multi-font and bold/italic support DYN-10382 - Cherry-pick multi-font and bold/italic support Apr 9, 2026
@johnpierson johnpierson marked this pull request as ready for review April 9, 2026 20:00
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10382

Copy link
Copy Markdown

@jasonstratton jasonstratton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@jasonstratton jasonstratton merged commit 1de8e13 into master Apr 9, 2026
10 of 11 checks passed
@jnealb
Copy link
Copy Markdown
Collaborator

jnealb commented Apr 9, 2026

svg rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cherry-pick multi-font and bold/italic support from Support-multiple-fonts-and-modernize

4 participants