Skip to content

Commit

Permalink
feat: add new fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Dec 23, 2024
1 parent c4a4c2d commit 887c9ab
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 14 deletions.
14 changes: 0 additions & 14 deletions apps/codeimage/changelog/1-8-3_12-23-2024.mdx

This file was deleted.

25 changes: 25 additions & 0 deletions apps/codeimage/changelog/1-8-4_12-23-2024.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {mdxComponents} from '../src/mdx/components';

# v1.8.4

<mdxComponents.h3>💬 New fonts</mdxComponents.h3>

This new version of CodeImage introduces new fonts into it's core:
- [Geist Mono](https://vercel.com/font)
- [IBM Plex Mono](https://github.com/IBM/plex)
- [Agave](https://github.com/blobject/agave)
- [Monaspace](https://monaspace.githubnext.com/) (all versions: Argon, Krypton, Neon, Radon, Xenon)


### 🎆 New CSS logo

`.css` extension icon has been updated with the new official [CSS logo](https://github.com/CSS-Next/logo.css)


### 🤖 New languages

This new version of CodeImage introduces support for new languages:
- Visual Basic
- Pascal

The PHP language has been updated to highlight syntax without `<?` opening tag.
19 changes: 19 additions & 0 deletions apps/codeimage/src/core/configuration/font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ export const [SUPPORTED_FONTS, SUPPORTED_FONTS_DICTIONARY] = createCustomFonts([
{name: 'Bold', weight: 700},
],
},
{
id: 'agave',
name: 'Agave',
type: 'web',
types: [{name: 'Regular', weight: 400}],
},
{
id: 'fira-code',
name: 'Fira Code',
Expand Down Expand Up @@ -112,4 +118,17 @@ export const [SUPPORTED_FONTS, SUPPORTED_FONTS_DICTIONARY] = createCustomFonts([
{name: 'Bold', weight: 700},
],
},
...['Argon', 'Krypton', 'Neon', 'Radon', 'Xenon'].map(
font =>
({
id: `monaspace-${font}`,
name: `Monaspace ${font}`,
type: 'web',
types: [
{name: 'Regular', weight: 400},
{name: 'Medium', weight: 500},
{name: 'Bold', weight: 700},
],
} as const),
),
] as const);
16 changes: 16 additions & 0 deletions apps/codeimage/src/theme/global.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,19 @@ globalFontFace('Geist Mono', {
src: `url(/assets/fonts/IBM_Plex_Mono/IBMPlexMono-${font}.ttf) format('truetype')`,
});
});

globalFontFace('Agave', {
fontDisplay: 'swap',
fontWeight: 400,
fontStyle: 'normal',
src: `url(/assets/fonts/agave/Agave-Regular.ttf) format('truetype')`,
});

(['Argon', 'Krypton', 'Neon', 'Radon', 'Xenon'] as const).forEach(font => {
globalFontFace(`Monaspace ${font}`, {
fontDisplay: 'swap',
fontWeight: '400 700',
fontStyle: 'normal',
src: `url(/assets/fonts/monaspace/Monaspace${font}VarVF[wght,wdth,slnt].ttf) format('truetype')`,
});
});

0 comments on commit 887c9ab

Please sign in to comment.