Skip to content

Ocrvs 11552#12334

Draft
kaykobadhossain wants to merge 3 commits intoopencrvs:developfrom
kaykobadhossain:ocrvs-11552
Draft

Ocrvs 11552#12334
kaykobadhossain wants to merge 3 commits intoopencrvs:developfrom
kaykobadhossain:ocrvs-11552

Conversation

@kaykobadhossain
Copy link
Copy Markdown

Description

This PR improves SVG font rendering by enhancing how @font-face rules are injected and how font variants (normal, bold, italic, and bold-italic) are handled.

Previously, SVG text styling did not reliably apply bold or italic fonts because font variants were not consistently mapped or matched against SVG font-weight and font-style attributes.

Changes made:
Improved addFontsToSvg function to generate more accurate @font-face rules per font variant.
Added proper mapping for font weight and style based on variant names (e.g. “Bold”, “Italic”).
Ensured SVG elements can correctly resolve font variants using font-weight and font-style.

Root cause:
Font variants were not being correctly matched between SVG attributes and @font-face declarations, leading to incorrect fallback fonts or missing bold/italic rendering.

Fix:
By explicitly defining font-weight and font-style in both the SVG and generated @font-face rules, the browser can now correctly resolve and apply the intended font variants.

Checklist

  • I have linked the correct Github issue under "Development"
  • I have tested the changes locally, and written appropriate tests
  • I have tested beyond the happy path (e.g. edge cases, failure paths)
  • I have updated the changelog with this change (if applicable)
  • I have updated the GitHub issue status accordingly

@kaykobadhossain kaykobadhossain marked this pull request as draft April 15, 2026 12:46
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.

Supplying italic/boldItalic font replaces the normal font in certificate preview

2 participants