Skip to content

Commit

Permalink
feat: Add script to get fonts on build
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliushaertl committed Dec 8, 2023
1 parent 1a3411f commit 2f7e4d0
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/assets/fonts
tests/clover.xml
.idea
node_modules/
Expand Down
1 change: 1 addition & 0 deletions .nextcloudignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
src
build
.git
tests
node_modules
Expand Down
1 change: 1 addition & 0 deletions assets/fonts/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fonts will be added here during release build thorugh the build/download-fonts.sh script.
Binary file removed assets/fonts/AmaticSC-Regular.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions krankerl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
before_cmds = [
"composer install --working-dir=composer/",
"composer dump --working-dir=composer/",
"./build/download-fonts.sh",
"npm ci",
"npm run build"
]
2 changes: 1 addition & 1 deletion lib/Migration/InstallDefaultFonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getName(): string {
public function run(IOutput $output): void {
$appVersion = $this->config->getAppValue('richdocuments', 'installed_version');

if (!empty($appVersion) && version_compare($appVersion, '8.2.2') < 1) {
if (empty($appVersion) || version_compare($appVersion, '8.3.0', '>')) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Service/FontService.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function installDefaultFonts(): void {
}

while (false !== ($fileName = readdir($handle))) {
if ($fileName === '.' || $fileName === '..') {
if (\str_starts_with($fileName, '.') || \str_ends_with($fileName, '.txt')) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ export default {
fontXmlHint() {
return `
<remote_font_config>
<url desc="URL of optional JSON file that lists fonts to be included in Online" type="string" default="">${this.fontHintUrl}</url>
<url>${this.fontHintUrl}</url>
</remote_font_config>
`
},
Expand Down

0 comments on commit 2f7e4d0

Please sign in to comment.