Skip to content

Commit 6fea737

Browse files
fix: deprecate unused fontData prop (#2753)
# Summary Fixes: #2478 The `fontData` property was created for internal usage within the library and was never intended to be exposed or used by external users. PR deprecate this prop to avoid confusion and ensure the public API remains clean and aligned with SVG standards. ## Test Plan Run example from issue: #2478, you should see a warning: <img width="577" height="189" alt="image" src="https://github.com/user-attachments/assets/a9cce281-84e5-4a20-806f-9c0ac0ec0d24" />
1 parent ce880ac commit 6fea737

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/extract/extractText.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ function parseFontString(font: string) {
5353
}
5454

5555
interface fontProps {
56-
fontData?: unknown;
5756
fontStyle?: string;
5857
fontVariant?: string;
5958
fontWeight?: NumberProp;
@@ -73,7 +72,6 @@ interface fontProps {
7372

7473
export function extractFont(props: fontProps) {
7574
const {
76-
fontData,
7775
fontStyle,
7876
fontVariant,
7977
fontWeight,
@@ -92,7 +90,6 @@ export function extractFont(props: fontProps) {
9290
} = props;
9391

9492
const ownedFont = pickNotNil({
95-
fontData,
9693
fontStyle,
9794
fontVariant,
9895
fontWeight,

src/lib/extract/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ export interface TextSpecificProps extends CommonPathProps, FontProps {
382382
verticalAlign?: NumberProp;
383383
lengthAdjust?: LengthAdjust;
384384
textLength?: NumberProp;
385+
/**
386+
* @deprecated Use other font props instead.
387+
*/
385388
fontData?: null | { [name: string]: unknown };
386389
fontFeatureSettings?: string;
387390
}

0 commit comments

Comments
 (0)