refactor(ComparisonView): unify pretext font string generation with a utility function
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
import { typographySettingsStore } from '$features/SetupFont/model';
|
||||
import { createPersistentStore } from '$shared/lib';
|
||||
import { untrack } from 'svelte';
|
||||
import { getPretextFontString } from '../../lib';
|
||||
|
||||
/**
|
||||
* Storage schema for comparison state
|
||||
@@ -205,8 +206,8 @@ export class ComparisonStore {
|
||||
return;
|
||||
}
|
||||
|
||||
const fontAString = `${weight} ${size}px "${fontAName}"`;
|
||||
const fontBString = `${weight} ${size}px "${fontBName}"`;
|
||||
const fontAString = getPretextFontString(weight, size, fontAName);
|
||||
const fontBString = getPretextFontString(weight, size, fontBName);
|
||||
|
||||
// Check if already loaded to avoid UI flash
|
||||
const isALoaded = document.fonts.check(fontAString);
|
||||
|
||||
Reference in New Issue
Block a user