File tree Expand file tree Collapse file tree 4 files changed +37
-4
lines changed
Expand file tree Collapse file tree 4 files changed +37
-4
lines changed Original file line number Diff line number Diff line change 44" @react-pdf/types " : minor
55---
66
7- Add support for fontFeatureSettings to customise ligatures, tabular number display, and other font features
7+ Add support for fontFeatureSettings to customize ligatures, tabular number display, and other font features
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ jobs:
111111 run : REACT_VERSION=${{ matrix.react_version }} yarn test
112112
113113 e2e-node :
114- name : Run E2E tests (Node.js ${{ matrix.node_version }}; ${{ matrix.cjs_or_esm == 'cjs' ? 'CJS' : 'ESM' }})
114+ name : ' E2E tests (Node.js ${{ matrix.node_version }}, ${{ matrix.cjs_or_esm }})'
115115 runs-on : ubuntu-latest
116116 strategy :
117117 matrix :
Original file line number Diff line number Diff line change @@ -321,13 +321,44 @@ export type TextTransform =
321321
322322export type VerticalAlign = 'sub' | 'super' ;
323323
324+ export type FontFeatureSetting =
325+ | 'liga'
326+ | 'dlig'
327+ | 'onum'
328+ | 'lnum'
329+ | 'tnum'
330+ | 'zero'
331+ | 'frac'
332+ | 'sups'
333+ | 'subs'
334+ | 'smcp'
335+ | 'c2sc'
336+ | 'case'
337+ | 'hlig'
338+ | 'calt'
339+ | 'swsh'
340+ | 'hist'
341+ | 'ss**'
342+ | 'kern'
343+ | 'locl'
344+ | 'rlig'
345+ | 'medi'
346+ | 'init'
347+ | 'isol'
348+ | 'fina'
349+ | 'mark'
350+ | 'mkmk' ;
351+ export type FontFeatureSettings =
352+ | FontFeatureSetting [ ]
353+ | Record < FontFeatureSetting , number > ;
354+
324355export type TextStyle = {
325356 direction ?: 'ltr' | 'rtl' ;
326357 fontSize ?: number | string ;
327358 fontFamily ?: string | string [ ] ;
328359 fontStyle ?: FontStyle ;
329360 fontWeight ?: FontWeight ;
330- fontFeatureSettings ?: string [ ] | Record < string , boolean > ;
361+ fontFeatureSettings ?: FontFeatureSettings ;
331362 letterSpacing ?: number | string ;
332363 lineHeight ?: number | string ;
333364 maxLines ?: number ;
@@ -348,6 +379,7 @@ export type TextSafeStyle = TextExpandedStyle & {
348379 fontWeight ?: number ;
349380 letterSpacing ?: number ;
350381 lineHeight ?: number ;
382+ fontFeatureSettings ?: FontFeatureSettings ;
351383} ;
352384
353385// Margins
Original file line number Diff line number Diff line change 11import type { Glyph as FontkitGlyph } from 'fontkit' ;
22import type { Font } from '@rpdf/font' ;
3+ import type { FontFeatureSettings } from '@rpdf/stylesheet' ;
34import { Factor as JustificationFactor } from './engines/justification/types' ;
45
56export type Coordinate = {
@@ -51,7 +52,7 @@ export type Attributes = {
5152 characterSpacing ?: number ;
5253 color ?: string ;
5354 direction ?: 'rtl' | 'ltr' ;
54- features ?: string [ ] | Record < string , number > ;
55+ features ?: FontFeatureSettings ;
5556 fill ?: boolean ;
5657 font ?: Font [ ] ;
5758 fontSize ?: number ;
You can’t perform that action at this time.
0 commit comments