vexflow-native 2.3.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/lib/module/base/FontManager.js +41 -27
- package/lib/module/base/FontManager.js.map +1 -1
- package/lib/module/base/VexflowCanvas.js +8 -6
- package/lib/module/base/VexflowCanvas.js.map +1 -1
- package/lib/module/base/VexflowRecordingClone.js +83 -0
- package/lib/module/base/VexflowRecordingClone.js.map +1 -0
- package/lib/module/base/VexflowRecordingContext.js +1 -80
- package/lib/module/base/VexflowRecordingContext.js.map +1 -1
- package/lib/module/base/builtInTextFont.js +21 -0
- package/lib/module/base/builtInTextFont.js.map +1 -0
- package/lib/module/base/cssFontShorthand.js +34 -0
- package/lib/module/base/cssFontShorthand.js.map +1 -0
- package/lib/module/base/fonts/OFL.txt +93 -0
- package/lib/module/base/fonts/academico.js +12 -0
- package/lib/module/base/fonts/academico.js.map +1 -0
- package/lib/module/base/pictureRetirement.js +70 -0
- package/lib/module/base/pictureRetirement.js.map +1 -0
- package/lib/module/base/setupVexflowReactNative.js +1 -36
- package/lib/module/base/setupVexflowReactNative.js.map +1 -1
- package/lib/module/musicxml/MusicXmlParser/MeasureParser.js +22 -119
- package/lib/module/musicxml/MusicXmlParser/MeasureParser.js.map +1 -1
- package/lib/module/musicxml/MusicXmlParser/MusicXmlNotes.js +129 -0
- package/lib/module/musicxml/MusicXmlParser/MusicXmlNotes.js.map +1 -0
- package/lib/module/musicxml/MusicXmlParser/PartParser.js +8 -1
- package/lib/module/musicxml/MusicXmlParser/PartParser.js.map +1 -1
- package/lib/module/musicxml/MusicXmlParser/Spanners.js +8 -5
- package/lib/module/musicxml/MusicXmlParser/Spanners.js.map +1 -1
- package/lib/module/musicxml/MusicXmlParser/mappers.js +83 -3
- package/lib/module/musicxml/MusicXmlParser/mappers.js.map +1 -1
- package/lib/module/renderer/Layout/DocumentLayout.js +13 -4
- package/lib/module/renderer/Layout/DocumentLayout.js.map +1 -1
- package/lib/module/renderer/Layout/VerticalSpacing.js +37 -7
- package/lib/module/renderer/Layout/VerticalSpacing.js.map +1 -1
- package/lib/module/renderer/ScoreRenderer/ScoreOverlayPicture.js +80 -46
- package/lib/module/renderer/ScoreRenderer/ScoreOverlayPicture.js.map +1 -1
- package/lib/module/renderer/ScoreRenderer/ScoreRenderer.js +10 -22
- package/lib/module/renderer/ScoreRenderer/ScoreRenderer.js.map +1 -1
- package/lib/module/renderer/ScoreRenderer/ScoreScrollbar.js +18 -8
- package/lib/module/renderer/ScoreRenderer/ScoreScrollbar.js.map +1 -1
- package/lib/module/renderer/ScoreRenderer/utils.js +42 -88
- package/lib/module/renderer/ScoreRenderer/utils.js.map +1 -1
- package/lib/module/renderer/constants.js +1 -1
- package/lib/module/renderer/layout.js +11 -4
- package/lib/module/renderer/layout.js.map +1 -1
- package/lib/module/renderer/lyrics.js +127 -0
- package/lib/module/renderer/lyrics.js.map +1 -0
- package/lib/module/renderer/measure.js +52 -13
- package/lib/module/renderer/measure.js.map +1 -1
- package/lib/module/renderer/measureBounds.js +5 -0
- package/lib/module/renderer/measureBounds.js.map +1 -1
- package/lib/module/renderer/measureModifiers.js +24 -6
- package/lib/module/renderer/measureModifiers.js.map +1 -1
- package/lib/module/renderer/noteModifiers.js +6 -14
- package/lib/module/renderer/noteModifiers.js.map +1 -1
- package/lib/module/renderer/{fixedNoteSpacing.js → noteSpacing.js} +46 -10
- package/lib/module/renderer/noteSpacing.js.map +1 -0
- package/lib/module/renderer/render.js +41 -21
- package/lib/module/renderer/render.js.map +1 -1
- package/lib/module/renderer/scale.js +8 -1
- package/lib/module/renderer/scale.js.map +1 -1
- package/lib/module/renderer/tempoMark.js +162 -0
- package/lib/module/renderer/tempoMark.js.map +1 -0
- package/lib/module/renderer/useScoreRecording.js +2 -1
- package/lib/module/renderer/useScoreRecording.js.map +1 -1
- package/lib/typescript/src/base/FontManager.d.ts +12 -7
- package/lib/typescript/src/base/FontManager.d.ts.map +1 -1
- package/lib/typescript/src/base/VexflowCanvas.d.ts.map +1 -1
- package/lib/typescript/src/base/VexflowRecordingClone.d.ts +8 -0
- package/lib/typescript/src/base/VexflowRecordingClone.d.ts.map +1 -0
- package/lib/typescript/src/base/VexflowRecordingContext.d.ts.map +1 -1
- package/lib/typescript/src/base/builtInTextFont.d.ts +6 -0
- package/lib/typescript/src/base/builtInTextFont.d.ts.map +1 -0
- package/lib/typescript/src/base/cssFontShorthand.d.ts +3 -0
- package/lib/typescript/src/base/cssFontShorthand.d.ts.map +1 -0
- package/lib/typescript/src/base/fonts/academico.d.ts +5 -0
- package/lib/typescript/src/base/fonts/academico.d.ts.map +1 -0
- package/lib/typescript/src/base/pictureRetirement.d.ts +26 -0
- package/lib/typescript/src/base/pictureRetirement.d.ts.map +1 -0
- package/lib/typescript/src/base/setupVexflowReactNative.d.ts +0 -8
- package/lib/typescript/src/base/setupVexflowReactNative.d.ts.map +1 -1
- package/lib/typescript/src/base/types.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/InternalTypes.d.ts +4 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/InternalTypes.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/MeasureParser.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/MusicXmlNotes.d.ts +13 -0
- package/lib/typescript/src/musicxml/MusicXmlParser/MusicXmlNotes.d.ts.map +1 -0
- package/lib/typescript/src/musicxml/MusicXmlParser/PartParser.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/Spanners.d.ts +6 -0
- package/lib/typescript/src/musicxml/MusicXmlParser/Spanners.d.ts.map +1 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/mappers.d.ts +7 -1
- package/lib/typescript/src/musicxml/MusicXmlParser/mappers.d.ts.map +1 -1
- package/lib/typescript/src/renderer/Layout/DocumentLayout.d.ts.map +1 -1
- package/lib/typescript/src/renderer/Layout/VerticalSpacing.d.ts +6 -0
- package/lib/typescript/src/renderer/Layout/VerticalSpacing.d.ts.map +1 -1
- package/lib/typescript/src/renderer/ScoreRenderer/ScoreOverlayPicture.d.ts +1 -1
- package/lib/typescript/src/renderer/ScoreRenderer/ScoreOverlayPicture.d.ts.map +1 -1
- package/lib/typescript/src/renderer/ScoreRenderer/ScoreRenderer.d.ts.map +1 -1
- package/lib/typescript/src/renderer/ScoreRenderer/ScoreScrollbar.d.ts +1 -0
- package/lib/typescript/src/renderer/ScoreRenderer/ScoreScrollbar.d.ts.map +1 -1
- package/lib/typescript/src/renderer/ScoreRenderer/types.d.ts +14 -11
- package/lib/typescript/src/renderer/ScoreRenderer/types.d.ts.map +1 -1
- package/lib/typescript/src/renderer/ScoreRenderer/utils.d.ts +8 -27
- package/lib/typescript/src/renderer/ScoreRenderer/utils.d.ts.map +1 -1
- package/lib/typescript/src/renderer/layout.d.ts +5 -1
- package/lib/typescript/src/renderer/layout.d.ts.map +1 -1
- package/lib/typescript/src/renderer/lyrics.d.ts +42 -0
- package/lib/typescript/src/renderer/lyrics.d.ts.map +1 -0
- package/lib/typescript/src/renderer/measure.d.ts +7 -2
- package/lib/typescript/src/renderer/measure.d.ts.map +1 -1
- package/lib/typescript/src/renderer/measureBounds.d.ts +3 -0
- package/lib/typescript/src/renderer/measureBounds.d.ts.map +1 -1
- package/lib/typescript/src/renderer/measureModifiers.d.ts +14 -4
- package/lib/typescript/src/renderer/measureModifiers.d.ts.map +1 -1
- package/lib/typescript/src/renderer/noteModifiers.d.ts +3 -2
- package/lib/typescript/src/renderer/noteModifiers.d.ts.map +1 -1
- package/lib/typescript/src/renderer/{fixedNoteSpacing.d.ts → noteSpacing.d.ts} +9 -1
- package/lib/typescript/src/renderer/noteSpacing.d.ts.map +1 -0
- package/lib/typescript/src/renderer/render.d.ts.map +1 -1
- package/lib/typescript/src/renderer/scale.d.ts.map +1 -1
- package/lib/typescript/src/renderer/tempoMark.d.ts +21 -0
- package/lib/typescript/src/renderer/tempoMark.d.ts.map +1 -0
- package/lib/typescript/src/renderer/types.d.ts +31 -7
- package/lib/typescript/src/renderer/types.d.ts.map +1 -1
- package/lib/typescript/src/state/types.d.ts +11 -3
- package/lib/typescript/src/state/types.d.ts.map +1 -1
- package/package.json +34 -26
- package/src/base/FontManager.ts +50 -31
- package/src/base/VexflowCanvas.tsx +10 -10
- package/src/base/VexflowRecordingClone.ts +89 -0
- package/src/base/VexflowRecordingContext.ts +8 -81
- package/src/base/builtInTextFont.ts +25 -0
- package/src/base/cssFontShorthand.ts +45 -0
- package/src/base/fonts/OFL.txt +93 -0
- package/src/base/fonts/academico.ts +10 -0
- package/src/base/pictureRetirement.ts +74 -0
- package/src/base/setupVexflowReactNative.ts +1 -49
- package/src/base/types.ts +0 -3
- package/src/musicxml/MusicXmlParser/InternalTypes.ts +5 -0
- package/src/musicxml/MusicXmlParser/MeasureParser.ts +31 -182
- package/src/musicxml/MusicXmlParser/MusicXmlNotes.ts +198 -0
- package/src/musicxml/MusicXmlParser/PartParser.ts +10 -3
- package/src/musicxml/MusicXmlParser/Spanners.ts +11 -8
- package/src/musicxml/MusicXmlParser/mappers.ts +55 -6
- package/src/renderer/Layout/DocumentLayout.ts +12 -3
- package/src/renderer/Layout/VerticalSpacing.ts +46 -13
- package/src/renderer/ScoreRenderer/ScoreOverlayPicture.tsx +127 -66
- package/src/renderer/ScoreRenderer/ScoreRenderer.tsx +8 -23
- package/src/renderer/ScoreRenderer/ScoreScrollbar.tsx +16 -2
- package/src/renderer/ScoreRenderer/types.ts +14 -12
- package/src/renderer/ScoreRenderer/utils.ts +54 -125
- package/src/renderer/constants.ts +1 -1
- package/src/renderer/layout.ts +19 -4
- package/src/renderer/lyrics.ts +163 -0
- package/src/renderer/measure.tsx +70 -12
- package/src/renderer/measureBounds.ts +10 -0
- package/src/renderer/measureModifiers.ts +27 -7
- package/src/renderer/noteModifiers.ts +9 -10
- package/src/renderer/{fixedNoteSpacing.ts → noteSpacing.ts} +60 -9
- package/src/renderer/render.tsx +63 -27
- package/src/renderer/scale.ts +9 -0
- package/src/renderer/tempoMark.ts +224 -0
- package/src/renderer/types.ts +32 -7
- package/src/renderer/useScoreRecording.ts +1 -0
- package/src/state/types.ts +11 -3
- package/lib/module/renderer/fixedNoteSpacing.js.map +0 -1
- package/lib/module/utils.js +0 -44
- package/lib/module/utils.js.map +0 -1
- package/lib/typescript/src/renderer/fixedNoteSpacing.d.ts.map +0 -1
- package/lib/typescript/src/utils.d.ts +0 -1
- package/lib/typescript/src/utils.d.ts.map +0 -1
- package/src/utils.tsx +0 -42
package/src/renderer/types.ts
CHANGED
|
@@ -172,9 +172,11 @@ export interface ScoreSpacing {
|
|
|
172
172
|
*/
|
|
173
173
|
lastSystemFill: 'justify' | 'natural';
|
|
174
174
|
/**
|
|
175
|
-
* Draw the clef on the first measure of every system
|
|
176
|
-
*
|
|
177
|
-
*
|
|
175
|
+
* Draw the clef and key signature on the first measure of every system, as
|
|
176
|
+
* engraving convention repeats them; line breaking reserves their width.
|
|
177
|
+
* `false` draws them on the first measure of the score only. A measure's
|
|
178
|
+
* explicit `leftModifiers.showClef` / `showKeySignature` still wins.
|
|
179
|
+
* Default true.
|
|
178
180
|
*/
|
|
179
181
|
clefOnEachSystem: boolean;
|
|
180
182
|
}
|
|
@@ -200,7 +202,9 @@ export interface RenderOptions {
|
|
|
200
202
|
/**
|
|
201
203
|
* Font family list for the text drawn on a score: annotations, lyrics and
|
|
202
204
|
* text directions. A family the font provider holds is taken from it;
|
|
203
|
-
* otherwise the system font manager resolves the list.
|
|
205
|
+
* otherwise the system font manager resolves the list. Without system fonts
|
|
206
|
+
* (CanvasKit on the web) a list naming no provider family draws with the
|
|
207
|
+
* built-in Academico face, VexFlow's default text font. Default
|
|
204
208
|
* `Arial, Helvetica, sans-serif`.
|
|
205
209
|
*/
|
|
206
210
|
textFontFamily: string;
|
|
@@ -256,8 +260,8 @@ export interface ScoreItemBounds {
|
|
|
256
260
|
|
|
257
261
|
/**
|
|
258
262
|
* Geometry of one rendered stave of a measure. Entries of the same measure
|
|
259
|
-
* share `x`/`width
|
|
260
|
-
*
|
|
263
|
+
* share `x`/`width` and `staveNoteStartX` (notes of a group start after its
|
|
264
|
+
* widest clef, key and time signature block); `staveNoteEndX` is per stave.
|
|
261
265
|
*/
|
|
262
266
|
export interface ScoreMeasureItemsLayout {
|
|
263
267
|
groupId: string;
|
|
@@ -268,7 +272,7 @@ export interface ScoreMeasureItemsLayout {
|
|
|
268
272
|
x: number;
|
|
269
273
|
/** Stave width. */
|
|
270
274
|
width: number;
|
|
271
|
-
/** X where notes
|
|
275
|
+
/** X where notes start, shared by every stave of the measure's group. */
|
|
272
276
|
staveNoteStartX: number;
|
|
273
277
|
/** X where the note area of this stave ends. */
|
|
274
278
|
staveNoteEndX: number;
|
|
@@ -288,6 +292,25 @@ export interface ScoreMeasureItemsLayout {
|
|
|
288
292
|
* read the drawn line from here. Always emitted by the renderer.
|
|
289
293
|
*/
|
|
290
294
|
visibleLineYs?: number[];
|
|
295
|
+
/**
|
|
296
|
+
* Factor the measure's note spacing was compressed by to fit its note area;
|
|
297
|
+
* absent when uncompressed. Re-engrave at a smaller `render.scale` to avoid
|
|
298
|
+
* the crowding.
|
|
299
|
+
*/
|
|
300
|
+
noteSpacingScale?: number;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** Geometry of one drawn tempo mark, same space as {@link ScoreItemsLayout}. */
|
|
304
|
+
export interface ScoreTempoMarkLayout {
|
|
305
|
+
/** `Direction.id` the mark was drawn from; not unique across measures. */
|
|
306
|
+
directionId: string;
|
|
307
|
+
staffId: string;
|
|
308
|
+
measureIndex: number;
|
|
309
|
+
systemIndex: number;
|
|
310
|
+
/** Whole mark: text, note glyph, dots, `=` and number. */
|
|
311
|
+
bounds: ScoreItemBounds;
|
|
312
|
+
/** The BPM number alone. */
|
|
313
|
+
bpmBounds: ScoreItemBounds;
|
|
291
314
|
}
|
|
292
315
|
|
|
293
316
|
/**
|
|
@@ -298,6 +321,8 @@ export interface ScoreItemsLayout {
|
|
|
298
321
|
items: Record<string, ScoreItemLayout>;
|
|
299
322
|
measures: ScoreMeasureItemsLayout[];
|
|
300
323
|
contentSize: RendererSize;
|
|
324
|
+
/** Drawn tempo marks in draw order. Always emitted by the renderer. */
|
|
325
|
+
tempoMarks?: ScoreTempoMarkLayout[];
|
|
301
326
|
}
|
|
302
327
|
|
|
303
328
|
export interface RendererPoint {
|
package/src/state/types.ts
CHANGED
|
@@ -190,11 +190,17 @@ export interface MeasureState {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
export interface MeasureLeftModifiers {
|
|
193
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* undefined = shown on the first measure and at every system start
|
|
195
|
+
* (`spacing.clefOnEachSystem`); false hides it there too.
|
|
196
|
+
*/
|
|
194
197
|
showClef?: boolean;
|
|
195
198
|
/** undefined = hidden. */
|
|
196
199
|
showMeter?: boolean;
|
|
197
|
-
/**
|
|
200
|
+
/**
|
|
201
|
+
* undefined = shown where the clef is by default; false hides it there too.
|
|
202
|
+
* Never drawn on a percussion clef.
|
|
203
|
+
*/
|
|
198
204
|
showKeySignature?: boolean;
|
|
199
205
|
/** undefined = 'single'; only 'single' and 'repeat-begin' render here. */
|
|
200
206
|
startBarline?: Barline;
|
|
@@ -214,11 +220,13 @@ export interface TextDirection {
|
|
|
214
220
|
placement?: 'above' | 'below';
|
|
215
221
|
}
|
|
216
222
|
|
|
217
|
-
/**
|
|
223
|
+
/** Drawn above its staff as a metronome mark; only a measure's first tempo
|
|
224
|
+
* direction is drawn. `MeasureState.tempo` stays data only. */
|
|
218
225
|
export interface TempoDirection {
|
|
219
226
|
id: Id;
|
|
220
227
|
type: 'tempo';
|
|
221
228
|
tempo: Tempo;
|
|
229
|
+
/** Not read by the renderer: the mark is always drawn above. */
|
|
222
230
|
placement?: 'above' | 'below';
|
|
223
231
|
}
|
|
224
232
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Stave","applyFixedNoteSpacing","formatter","voices","stave","contexts","getTickContexts","lastTickKey","list","length","undefined","totalTicks","getTotalTicks","value","multiplier","resolutionMultiplier","lastTick","stavePadding","defaultPadding","rightPadding","noteAreaWidth","getNoteEndX","getNoteStartX","firstLeft","map","getMetrics","totalLeftPx","span","lastContext","lastOverflow","getWidth","tickKey","setX"],"sourceRoot":"../../../src","sources":["renderer/fixedNoteSpacing.ts"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,SAAS;AAG/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CACnCC,SAAoB,EACpBC,MAAiB,EACjBC,KAAY,EACZ;EACA,MAAMC,QAAQ,GAAGH,SAAS,CAACI,eAAe,CAAC,CAAC;EAC5C,MAAMC,WAAW,GAAGF,QAAQ,EAAEG,IAAI,CAACH,QAAQ,CAACG,IAAI,CAACC,MAAM,GAAG,CAAC,CAAC;EAE5D,IACE,CAACJ,QAAQ,IACTF,MAAM,CAACM,MAAM,KAAK,CAAC,IACnBF,WAAW,KAAKG,SAAS,IACzBH,WAAW,IAAI,CAAC,EAChB;IACA;EACF;EAEA,MAAMI,UAAU,GAAGR,MAAM,CAAC,CAAC,CAAC,EAAES,aAAa,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,IAAI,CAAC;EAE1D,IAAI,EAAEF,UAAU,GAAG,CAAC,CAAC,EAAE;IACrB;EACF;;EAEA;EACA;EACA;EACA;EACA;EACA,MAAMG,UAAU,GAAGT,QAAQ,CAACU,oBAAoB,IAAI,CAAC;EACrD,MAAMC,QAAQ,GAAGT,WAAW,GAAGO,UAAU;;EAEzC;EACA;EACA;EACA;EACA,MAAMG,YAAY,GAAGjB,KAAK,CAACkB,cAAc,GAAGlB,KAAK,CAACmB,YAAY;EAC9D,MAAMC,aAAa,GACjBhB,KAAK,CAACiB,WAAW,CAAC,CAAC,GAAGjB,KAAK,CAACkB,aAAa,CAAC,CAAC,GAAGL,YAAY;EAC5D,MAAMM,SAAS,GAAGlB,QAAQ,CAACmB,GAAG,CAACnB,QAAQ,CAACG,IAAI,CAAC,CAAC,CAAC,CAAE,CAAEiB,UAAU,CAAC,CAAC,CAACC,WAAW;EAC3E,IAAIC,IAAI,GAAGP,aAAa,GAAGG,SAAS;EAEpC,MAAMK,WAAW,GAAGvB,QAAQ,CAACmB,GAAG,CAACjB,WAAW,CAAE;EAC9C,MAAMsB,YAAY,GAChBN,SAAS,GACRP,QAAQ,GAAGL,UAAU,GAAIgB,IAAI,GAC9BC,WAAW,CAACE,QAAQ,CAAC,CAAC,GACtBV,aAAa;EAEf,IAAIS,YAAY,GAAG,CAAC,EAAE;IACpBF,IAAI,IAAKE,YAAY,GAAGlB,UAAU,GAAIK,QAAQ;EAChD;EAEA,IAAI,EAAEW,IAAI,GAAG,CAAC,CAAC,EAAE;IACf;EACF;EAEA,KAAK,MAAMI,OAAO,IAAI1B,QAAQ,CAACG,IAAI,EAAE;IACnCH,QAAQ,CAACmB,GAAG,CAACO,OAAO,CAAC,CAAEC,IAAI,CACzBT,SAAS,GAAIQ,OAAO,GAAGjB,UAAU,GAAGH,UAAU,GAAIgB,IACpD,CAAC;EACH;AACF","ignoreList":[]}
|
package/lib/module/utils.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// import { PT_TO_PX } from './constants';
|
|
2
|
-
// import { type ParsedCssFont } from './types';
|
|
3
|
-
|
|
4
|
-
// export function toPxFontSize(size: number | string | undefined): number {
|
|
5
|
-
// if (size === undefined || size === null) return 12;
|
|
6
|
-
|
|
7
|
-
// if (typeof size === 'number' && Number.isFinite(size)) {
|
|
8
|
-
// return size * PT_TO_PX;
|
|
9
|
-
// }
|
|
10
|
-
|
|
11
|
-
// if (typeof size === 'string') {
|
|
12
|
-
// const match = size.trim().match(/^(\d+(?:\.\d+)?)(px|pt)?$/i);
|
|
13
|
-
|
|
14
|
-
// if (match) {
|
|
15
|
-
// const value = Number.parseFloat(match[1] || '12');
|
|
16
|
-
// const unit = match[2]?.toLowerCase();
|
|
17
|
-
// if (!unit || unit === 'px') return value;
|
|
18
|
-
// return value * PT_TO_PX;
|
|
19
|
-
// }
|
|
20
|
-
// }
|
|
21
|
-
|
|
22
|
-
// return 12;
|
|
23
|
-
// }
|
|
24
|
-
|
|
25
|
-
// export function parseCssFontShorthand(cssFont: string): ParsedCssFont {
|
|
26
|
-
// const sizeMatch = cssFont.match(/(\d+(?:\.\d+)?(?:px|pt))/i);
|
|
27
|
-
|
|
28
|
-
// if (!sizeMatch) {
|
|
29
|
-
// return { sizePx: 12 };
|
|
30
|
-
// }
|
|
31
|
-
|
|
32
|
-
// const sizePx = toPxFontSize(sizeMatch[1]);
|
|
33
|
-
|
|
34
|
-
// const family = cssFont
|
|
35
|
-
// .slice((sizeMatch.index ?? 0) + (sizeMatch[1]?.length || 0))
|
|
36
|
-
// .trim();
|
|
37
|
-
|
|
38
|
-
// return {
|
|
39
|
-
// sizePx,
|
|
40
|
-
// family: family || undefined,
|
|
41
|
-
// };
|
|
42
|
-
// }
|
|
43
|
-
"use strict";
|
|
44
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/module/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["utils.tsx"],"mappings":"AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixedNoteSpacing.d.ts","sourceRoot":"","sources":["../../../../src/renderer/fixedNoteSpacing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,OAAO,EAAE,EACjB,KAAK,EAAE,KAAK,QA0Db"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.tsx"],"names":[],"mappings":""}
|
package/src/utils.tsx
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// import { PT_TO_PX } from './constants';
|
|
2
|
-
// import { type ParsedCssFont } from './types';
|
|
3
|
-
|
|
4
|
-
// export function toPxFontSize(size: number | string | undefined): number {
|
|
5
|
-
// if (size === undefined || size === null) return 12;
|
|
6
|
-
|
|
7
|
-
// if (typeof size === 'number' && Number.isFinite(size)) {
|
|
8
|
-
// return size * PT_TO_PX;
|
|
9
|
-
// }
|
|
10
|
-
|
|
11
|
-
// if (typeof size === 'string') {
|
|
12
|
-
// const match = size.trim().match(/^(\d+(?:\.\d+)?)(px|pt)?$/i);
|
|
13
|
-
|
|
14
|
-
// if (match) {
|
|
15
|
-
// const value = Number.parseFloat(match[1] || '12');
|
|
16
|
-
// const unit = match[2]?.toLowerCase();
|
|
17
|
-
// if (!unit || unit === 'px') return value;
|
|
18
|
-
// return value * PT_TO_PX;
|
|
19
|
-
// }
|
|
20
|
-
// }
|
|
21
|
-
|
|
22
|
-
// return 12;
|
|
23
|
-
// }
|
|
24
|
-
|
|
25
|
-
// export function parseCssFontShorthand(cssFont: string): ParsedCssFont {
|
|
26
|
-
// const sizeMatch = cssFont.match(/(\d+(?:\.\d+)?(?:px|pt))/i);
|
|
27
|
-
|
|
28
|
-
// if (!sizeMatch) {
|
|
29
|
-
// return { sizePx: 12 };
|
|
30
|
-
// }
|
|
31
|
-
|
|
32
|
-
// const sizePx = toPxFontSize(sizeMatch[1]);
|
|
33
|
-
|
|
34
|
-
// const family = cssFont
|
|
35
|
-
// .slice((sizeMatch.index ?? 0) + (sizeMatch[1]?.length || 0))
|
|
36
|
-
// .trim();
|
|
37
|
-
|
|
38
|
-
// return {
|
|
39
|
-
// sizePx,
|
|
40
|
-
// family: family || undefined,
|
|
41
|
-
// };
|
|
42
|
-
// }
|