Use custom font (#2343)
This PR adds our custom version of Shantell Sans. Not sure if we need to keep the old file around for backwards compat? ### Change Type - [x] `major` ### Release Notes - Add a brief release note for your PR here. --------- Co-authored-by: huppy-bot[bot] <128400622+huppy-bot[bot]@users.noreply.github.com>pull/2358/head
Przed Szerokość: | Wysokość: | Rozmiar: 4.7 KiB Po Szerokość: | Wysokość: | Rozmiar: 5.2 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 4.7 KiB Po Szerokość: | Wysokość: | Rozmiar: 5.2 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 4.7 KiB Po Szerokość: | Wysokość: | Rozmiar: 5.2 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 4.7 KiB Po Szerokość: | Wysokość: | Rozmiar: 5.2 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 3.9 KiB Po Szerokość: | Wysokość: | Rozmiar: 4.3 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 3.9 KiB Po Szerokość: | Wysokość: | Rozmiar: 4.3 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 4.0 KiB Po Szerokość: | Wysokość: | Rozmiar: 4.5 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 4.0 KiB Po Szerokość: | Wysokość: | Rozmiar: 4.5 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 1.9 KiB Po Szerokość: | Wysokość: | Rozmiar: 2.5 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 1.9 KiB Po Szerokość: | Wysokość: | Rozmiar: 2.5 KiB |
|
@ -67,7 +67,7 @@ test.describe('text measurement', () => {
|
||||||
measureTextOptions
|
measureTextOptions
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(w).toBeCloseTo(85.828125, 0)
|
expect(w).toBeCloseTo(87, 0)
|
||||||
expect(h).toBeCloseTo(32.3984375, 0)
|
expect(h).toBeCloseTo(32.3984375, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ test.describe('text measurement', () => {
|
||||||
measureTextSpansOptions
|
measureTextSpansOptions
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(formatLines(spans)).toEqual([['test'], ['ing']])
|
expect(formatLines(spans)).toEqual([['tes'], ['ting']])
|
||||||
})
|
})
|
||||||
|
|
||||||
test('should preserve whitespace at line breaks', async () => {
|
test('should preserve whitespace at line breaks', async () => {
|
||||||
|
@ -202,11 +202,11 @@ test.describe('text measurement', () => {
|
||||||
|
|
||||||
expect(formatLines(spans)).toEqual([
|
expect(formatLines(spans)).toEqual([
|
||||||
['testingt'],
|
['testingt'],
|
||||||
['estingte'],
|
['estingt'],
|
||||||
['stingtes'],
|
['estingt'],
|
||||||
['tingtest'],
|
['estingt'],
|
||||||
['ingtesti'],
|
['estingt'],
|
||||||
['ng'],
|
['esting'],
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import embedIconsYoutube from './embed-icons/youtube.png'
|
||||||
import fontsMonospace from './fonts/IBMPlexMono-Medium.woff2'
|
import fontsMonospace from './fonts/IBMPlexMono-Medium.woff2'
|
||||||
import fontsSansSerif from './fonts/IBMPlexSans-Medium.woff2'
|
import fontsSansSerif from './fonts/IBMPlexSans-Medium.woff2'
|
||||||
import fontsSerif from './fonts/IBMPlexSerif-Medium.woff2'
|
import fontsSerif from './fonts/IBMPlexSerif-Medium.woff2'
|
||||||
import fontsDraw from './fonts/Shantell_Sans-Normal-SemiBold.woff2'
|
import fontsDraw from './fonts/Shantell_Sans-Tldrawish.woff2'
|
||||||
import iconsAlignBottomCenter from './icons/icon/align-bottom-center.svg'
|
import iconsAlignBottomCenter from './icons/icon/align-bottom-center.svg'
|
||||||
import iconsAlignBottomLeft from './icons/icon/align-bottom-left.svg'
|
import iconsAlignBottomLeft from './icons/icon/align-bottom-left.svg'
|
||||||
import iconsAlignBottomRight from './icons/icon/align-bottom-right.svg'
|
import iconsAlignBottomRight from './icons/icon/align-bottom-right.svg'
|
||||||
|
|
|
@ -15,7 +15,7 @@ export function getAssetUrls(opts) {
|
||||||
monospace: formatAssetUrl('./fonts/IBMPlexMono-Medium.woff2', opts),
|
monospace: formatAssetUrl('./fonts/IBMPlexMono-Medium.woff2', opts),
|
||||||
sansSerif: formatAssetUrl('./fonts/IBMPlexSans-Medium.woff2', opts),
|
sansSerif: formatAssetUrl('./fonts/IBMPlexSans-Medium.woff2', opts),
|
||||||
serif: formatAssetUrl('./fonts/IBMPlexSerif-Medium.woff2', opts),
|
serif: formatAssetUrl('./fonts/IBMPlexSerif-Medium.woff2', opts),
|
||||||
draw: formatAssetUrl('./fonts/Shantell_Sans-Normal-SemiBold.woff2', opts),
|
draw: formatAssetUrl('./fonts/Shantell_Sans-Tldrawish.woff2', opts),
|
||||||
},
|
},
|
||||||
icons: {
|
icons: {
|
||||||
'align-bottom-center': formatAssetUrl('./icons/icon/align-bottom-center.svg', opts),
|
'align-bottom-center': formatAssetUrl('./icons/icon/align-bottom-center.svg', opts),
|
||||||
|
|
|
@ -25,7 +25,7 @@ export function getAssetUrlsByMetaUrl(opts) {
|
||||||
opts
|
opts
|
||||||
),
|
),
|
||||||
draw: formatAssetUrl(
|
draw: formatAssetUrl(
|
||||||
new URL('./fonts/Shantell_Sans-Normal-SemiBold.woff2', import.meta.url).href,
|
new URL('./fonts/Shantell_Sans-Tldrawish.woff2', import.meta.url).href,
|
||||||
opts
|
opts
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,7 +15,7 @@ export type TLEditorAssetUrls = {
|
||||||
/** @public */
|
/** @public */
|
||||||
export let defaultEditorAssetUrls: TLEditorAssetUrls = {
|
export let defaultEditorAssetUrls: TLEditorAssetUrls = {
|
||||||
fonts: {
|
fonts: {
|
||||||
draw: `https://unpkg.com/@tldraw/assets@${version}/fonts/Shantell_Sans-Normal-SemiBold.woff2`,
|
draw: `https://unpkg.com/@tldraw/assets@${version}/fonts/Shantell_Sans-Tldrawish.woff2`,
|
||||||
serif: `https://unpkg.com/@tldraw/assets@${version}/fonts/IBMPlexSerif-Medium.woff2`,
|
serif: `https://unpkg.com/@tldraw/assets@${version}/fonts/IBMPlexSerif-Medium.woff2`,
|
||||||
sansSerif: `https://unpkg.com/@tldraw/assets@${version}/fonts/IBMPlexSans-Medium.woff2`,
|
sansSerif: `https://unpkg.com/@tldraw/assets@${version}/fonts/IBMPlexSans-Medium.woff2`,
|
||||||
monospace: `https://unpkg.com/@tldraw/assets@${version}/fonts/IBMPlexMono-Medium.woff2`,
|
monospace: `https://unpkg.com/@tldraw/assets@${version}/fonts/IBMPlexMono-Medium.woff2`,
|
||||||
|
|
|
@ -18,7 +18,7 @@ const FONT_MAPPING: Record<string, string> = {
|
||||||
'IBMPlexMono-Medium': 'monospace',
|
'IBMPlexMono-Medium': 'monospace',
|
||||||
'IBMPlexSerif-Medium': 'serif',
|
'IBMPlexSerif-Medium': 'serif',
|
||||||
'IBMPlexSans-Medium': 'sansSerif',
|
'IBMPlexSans-Medium': 'sansSerif',
|
||||||
'Shantell_Sans-Normal-SemiBold': 'draw',
|
'Shantell_Sans-Tldrawish': 'draw',
|
||||||
}
|
}
|
||||||
|
|
||||||
const ASSETS_FOLDER_PATH = join(BUBLIC_ROOT, 'assets')
|
const ASSETS_FOLDER_PATH = join(BUBLIC_ROOT, 'assets')
|
||||||
|
|