From 8de4ad9979ec3ab7d7dfb5a0a009a18c86c973ee Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Fri, 23 Jun 2023 20:52:05 +0300 Subject: [PATCH] add default font for arimo font --- apps/red-ui/ngsw-config.json | 4 ++-- .../pdf-viewer/services/pdf-viewer.service.ts | 7 ++++--- apps/red-ui/src/assets/pdftron/fonts.json | 5 +++++ docker/red-ui/Dockerfile | 18 ++++++++---------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/apps/red-ui/ngsw-config.json b/apps/red-ui/ngsw-config.json index f59cbb23c..a8747d956 100644 --- a/apps/red-ui/ngsw-config.json +++ b/apps/red-ui/ngsw-config.json @@ -6,7 +6,7 @@ "name": "app", "installMode": "prefetch", "resources": { - "files": ["/favicon.ico", "/manifest.webmanifest", "/*.css", "/*.js", "!/assets/wv-resources/**"] + "files": ["/favicon.ico", "/manifest.webmanifest", "/*.css", "/*.js"] } }, { @@ -14,7 +14,7 @@ "installMode": "lazy", "updateMode": "prefetch", "resources": { - "files": ["/assets/**", "!/assets/wv-resources/**", "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"] + "files": ["/assets/**", "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"] } } ] diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts index baec0d39b..cf68ffbf3 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts @@ -13,6 +13,7 @@ import { asList } from '../utils/functions'; import { TranslateService } from '@ngx-translate/core'; import { LicenseService } from '@services/license.service'; import { UserPreferenceService } from '@users/user-preference.service'; +import { environment } from '@environments/environment'; import TextTool = Core.Tools.TextTool; import Annotation = Core.Annotations.Annotation; import TextHighlightAnnotation = Core.Annotations.TextHighlightAnnotation; @@ -149,9 +150,9 @@ export class PdfViewer { async init(htmlElement: HTMLElement) { this.#instance = await this.#getInstance(htmlElement); - // if (environment.production) { - // this.#instance.Core.setCustomFontURL('http://' + window.location.host + this._convertPath('/assets/pdftron')); - // } + if (environment.production) { + this.#instance.Core.setCustomFontURL('https://' + window.location.host + this._convertPath('/assets/pdftron')); + } try { await this.PDFNet.initialize(this._licenseService.activeLicenseKey); diff --git a/apps/red-ui/src/assets/pdftron/fonts.json b/apps/red-ui/src/assets/pdftron/fonts.json index a5fb1b601..c42cfcf7b 100644 --- a/apps/red-ui/src/assets/pdftron/fonts.json +++ b/apps/red-ui/src/assets/pdftron/fonts.json @@ -22,6 +22,11 @@ "target": "m+1p1", "type": "Wildcard" }, + { + "match": "Arimo*", + "target": "m+1p1", + "type": "Wildcard" + }, { "target": "m+1p1", "type": "All" diff --git a/docker/red-ui/Dockerfile b/docker/red-ui/Dockerfile index 397c690fc..a6f32ab0f 100644 --- a/docker/red-ui/Dockerfile +++ b/docker/red-ui/Dockerfile @@ -10,14 +10,12 @@ RUN jq '{ dependencies, devDependencies, peerDependencies, scripts: (.scripts | # We label our stage as ‘builder’ FROM node:18.16-buster as builder -#RUN apt-get update && apt-get install -y jq +RUN apt-get update && apt-get install -y jq COPY --from=prep /tmp/deps.json ./package.json COPY yarn.lock ./ ## Storing node modules on a separate layer will prevent unnecessary npm installs at each build -RUN yarn cache clean -RUN rm -rf ./node_modules RUN yarn install && mkdir /ng-app && mv ./node_modules ./ng-app ARG bamboo_sonarqube_api_token_secret ENV bamboo_sonarqube_api_token_secret=$bamboo_sonarqube_api_token_secret @@ -28,13 +26,13 @@ COPY apps apps COPY libs libs COPY tools tools COPY package.json package.json -#COPY version.json version.json -#RUN cat version.json -#RUN version=$(jq .FRONTEND_APP_VERSION version.json -r | cat) && \ -# jq --arg version "$version" '.version = $version' package.json > tmp.json && \ -# mv tmp.json package.json -# -#RUN cat package.json +COPY version.json version.json +RUN cat version.json +RUN version=$(jq .FRONTEND_APP_VERSION version.json -r | cat) && \ + jq --arg version "$version" '.version = $version' package.json > tmp.json && \ + mv tmp.json package.json + +RUN cat package.json COPY yarn.lock yarn.lock COPY angular.json angular.json COPY nx.json nx.json