Merge pull request #220 from dmitrylyzo/fix-missing-font

Fix missing fonts
This commit is contained in:
Dmitry Lyzo 2023-11-03 11:29:08 +03:00 committed by GitHub
commit 157cadde2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -40,13 +40,15 @@ _Also look [Wiki](https://github.com/jellyfin/jellyfin-tizen/wiki)._
```sh
cd jellyfin-web
SKIP_PREPARE=1 npm ci --no-audit
npm run build:production
USE_SYSTEM_FONTS=1 npm run build:production
```
> You should get `jellyfin-web/dist/` directory.
> `SKIP_PREPARE=1` can be omitted for 10.9+.
> `USE_SYSTEM_FONTS=1` is required to discard unused fonts and to reduce the size of the app. (Since Jellyfin Web 10.9)
> Use `npm run build:development` if you want to debug the app.
If any changes are made to `jellyfin-web/`, the `jellyfin-web/dist/` directory will need to be rebuilt using the command above.
@ -62,6 +64,9 @@ JELLYFIN_WEB_DIR=../jellyfin-web/dist npm ci --no-audit
> The `JELLYFIN_WEB_DIR` environment variable can be used to override the location of `jellyfin-web`.
> Add `DISCARD_UNUSED_FONTS=1` environment variable to discard unused fonts and to reduce the size of the app. (Until Jellyfin Web 10.9)
> Don't use it with Jellyfin Web 10.9+. Instead, use `USE_SYSTEM_FONTS=1` environment variable when building Jellyfin Web.
If any changes are made to `jellyfin-web/dist/`, the `jellyfin-tizen/www/` directory will need to be rebuilt using the command above.
### Build WGT

View File

@ -11,12 +11,13 @@ var WEB_DIR = process.env.JELLYFIN_WEB_DIR || 'node_modules/jellyfin-web/dist';
WEB_DIR = path.resolve(WEB_DIR);
console.info('Using jellyfin-web from', WEB_DIR);
const DISCARD_UNUSED_FONTS = !!process.env.DISCARD_UNUSED_FONTS;
var paths = {
assets: {
src: [
WEB_DIR + '/**/*',
'!' + WEB_DIR + '/index.html',
'!' + WEB_DIR + '/*.woff2' // exclude Noto Sans fonts (not used)
'!' + WEB_DIR + '/index.html'
],
dest: 'www/'
},
@ -35,7 +36,12 @@ function clean() {
// Search for used fonts and add them to assets
function searchFonts() {
if (!DISCARD_UNUSED_FONTS) return Promise.resolve('skipped');
const assets = paths.assets.src;
assets.push('!' + WEB_DIR + '/*.woff2');
return gulp.src(WEB_DIR + '/main*.js')
.pipe(scan({
term: /[a-z0-9._-]*\.woff2/gi,

View File

@ -7,6 +7,7 @@
"url": "git+https://github.com/jellyfin/jellyfin-tizen.git"
},
"scripts": {
"build": "gulp",
"postinstall": "gulp"
},
"devDependencies": {