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>
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.5 KiB |
|
@ -67,7 +67,7 @@ test.describe('text measurement', () => {
|
|||
measureTextOptions
|
||||
)
|
||||
|
||||
expect(w).toBeCloseTo(85.828125, 0)
|
||||
expect(w).toBeCloseTo(87, 0)
|
||||
expect(h).toBeCloseTo(32.3984375, 0)
|
||||
})
|
||||
|
||||
|
@ -104,7 +104,7 @@ test.describe('text measurement', () => {
|
|||
measureTextSpansOptions
|
||||
)
|
||||
|
||||
expect(formatLines(spans)).toEqual([['test'], ['ing']])
|
||||
expect(formatLines(spans)).toEqual([['tes'], ['ting']])
|
||||
})
|
||||
|
||||
test('should preserve whitespace at line breaks', async () => {
|
||||
|
@ -202,11 +202,11 @@ test.describe('text measurement', () => {
|
|||
|
||||
expect(formatLines(spans)).toEqual([
|
||||
['testingt'],
|
||||
['estingte'],
|
||||
['stingtes'],
|
||||
['tingtest'],
|
||||
['ingtesti'],
|
||||
['ng'],
|
||||
['estingt'],
|
||||
['estingt'],
|
||||
['estingt'],
|
||||
['estingt'],
|
||||
['esting'],
|
||||
])
|
||||
})
|
||||
|
||||
|
|
BIN
assets/fonts/Shantell_Sans-Tldrawish.woff2
Normal file
|
@ -25,7 +25,7 @@ import embedIconsYoutube from './embed-icons/youtube.png'
|
|||
import fontsMonospace from './fonts/IBMPlexMono-Medium.woff2'
|
||||
import fontsSansSerif from './fonts/IBMPlexSans-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 iconsAlignBottomLeft from './icons/icon/align-bottom-left.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),
|
||||
sansSerif: formatAssetUrl('./fonts/IBMPlexSans-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: {
|
||||
'align-bottom-center': formatAssetUrl('./icons/icon/align-bottom-center.svg', opts),
|
||||
|
|
|
@ -25,7 +25,7 @@ export function getAssetUrlsByMetaUrl(opts) {
|
|||
opts
|
||||
),
|
||||
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
|
||||
),
|
||||
},
|
||||
|
|
|
@ -15,7 +15,7 @@ export type TLEditorAssetUrls = {
|
|||
/** @public */
|
||||
export let defaultEditorAssetUrls: TLEditorAssetUrls = {
|
||||
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`,
|
||||
sansSerif: `https://unpkg.com/@tldraw/assets@${version}/fonts/IBMPlexSans-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',
|
||||
'IBMPlexSerif-Medium': 'serif',
|
||||
'IBMPlexSans-Medium': 'sansSerif',
|
||||
'Shantell_Sans-Normal-SemiBold': 'draw',
|
||||
'Shantell_Sans-Tldrawish': 'draw',
|
||||
}
|
||||
|
||||
const ASSETS_FOLDER_PATH = join(BUBLIC_ROOT, 'assets')
|
||||
|
|