feat: implement offline fonts support (v0.1.4)
- Add local font files to public/fonts directory - Replace Google Fonts CDN with local @font-face declarations - Include both regular and italic variants for preview fonts - Remove unused editor italic fonts to reduce bundle size - App now fully functional offline without external dependencies - Total font bundle: ~22.8 MB (10 font files)
This commit is contained in:
10
index.html
10
index.html
@@ -4,13 +4,9 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Tauri + React + Typescript</title>
|
<title>Nextcloud Notes</title>
|
||||||
<!-- Editor fonts (monospace) -->
|
<!-- Local fonts for offline support -->
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="stylesheet" href="/fonts/fonts.css">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@200..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap" rel="stylesheet">
|
|
||||||
<!-- Preview fonts (serif) -->
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Average&family=Crimson+Pro:ital,wght@0,200..900;1,200..900&family=Merriweather:ital,opsz,wght@0,18..144,300..900;1,18..144,300..900&family=Roboto+Serif:ital,opsz,wght@0,8..144,100..900;1,8..144,100..900&display=swap" rel="stylesheet">
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "nextcloud-notes-tauri",
|
"name": "nextcloud-notes-tauri",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
BIN
public/fonts/Average-Regular.ttf
Normal file
BIN
public/fonts/Average-Regular.ttf
Normal file
Binary file not shown.
BIN
public/fonts/CrimsonPro-Italic-VariableFont_wght.ttf
Normal file
BIN
public/fonts/CrimsonPro-Italic-VariableFont_wght.ttf
Normal file
Binary file not shown.
BIN
public/fonts/CrimsonPro-VariableFont_wght.ttf
Normal file
BIN
public/fonts/CrimsonPro-VariableFont_wght.ttf
Normal file
Binary file not shown.
BIN
public/fonts/Inconsolata-VariableFont_wdth,wght.ttf
Normal file
BIN
public/fonts/Inconsolata-VariableFont_wdth,wght.ttf
Normal file
Binary file not shown.
BIN
public/fonts/Merriweather-Italic-VariableFont_opsz,wdth,wght.ttf
Normal file
BIN
public/fonts/Merriweather-Italic-VariableFont_opsz,wdth,wght.ttf
Normal file
Binary file not shown.
BIN
public/fonts/Merriweather-VariableFont_opsz,wdth,wght.ttf
Normal file
BIN
public/fonts/Merriweather-VariableFont_opsz,wdth,wght.ttf
Normal file
Binary file not shown.
BIN
public/fonts/RobotoMono-VariableFont_wght.ttf
Normal file
BIN
public/fonts/RobotoMono-VariableFont_wght.ttf
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/fonts/RobotoSerif-VariableFont_GRAD,opsz,wdth,wght.ttf
Normal file
BIN
public/fonts/RobotoSerif-VariableFont_GRAD,opsz,wdth,wght.ttf
Normal file
Binary file not shown.
BIN
public/fonts/SourceCodePro-VariableFont_wght.ttf
Normal file
BIN
public/fonts/SourceCodePro-VariableFont_wght.ttf
Normal file
Binary file not shown.
90
public/fonts/fonts.css
Normal file
90
public/fonts/fonts.css
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
/* Editor Fonts (Monospace) */
|
||||||
|
|
||||||
|
/* Source Code Pro */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Source Code Pro';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 200 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./SourceCodePro-VariableFont_wght.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Roboto Mono */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto Mono';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./RobotoMono-VariableFont_wght.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inconsolata */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inconsolata';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 200 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./Inconsolata-VariableFont_wdth,wght.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Preview Fonts (Serif) */
|
||||||
|
|
||||||
|
/* Merriweather */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Merriweather';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 300 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./Merriweather-VariableFont_opsz,wdth,wght.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Merriweather';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 300 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./Merriweather-Italic-VariableFont_opsz,wdth,wght.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Crimson Pro */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Crimson Pro';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 200 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./CrimsonPro-VariableFont_wght.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Crimson Pro';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 200 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./CrimsonPro-Italic-VariableFont_wght.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Roboto Serif */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto Serif';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./RobotoSerif-VariableFont_GRAD,opsz,wdth,wght.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto Serif';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 100 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./RobotoSerif-Italic-VariableFont_GRAD,opsz,wdth,wght.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Average */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Average';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url('./Average-Regular.ttf') format('truetype');
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Nextcloud Notes",
|
"productName": "Nextcloud Notes",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"identifier": "com.davidrelich.nextcloud-notes",
|
"identifier": "com.davidrelich.nextcloud-notes",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|||||||
Reference in New Issue
Block a user