-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print (WIP), fake scan (WIP) and text conversion for ultra-lite #1098
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8b5fd6b
Changes!
Frooodle c06ee54
lang
Frooodle 78e48e7
Merge branch 'main' into changes
Frooodle e6a4c61
fake scan init, print init and pdf to text for exe
Frooodle 9403426
Merge branch 'main' into changes
Frooodle 8c824e4
Hardening suggestions for Stirling-PDF / changes (#1099)
pixeebot[bot] 8842ab8
Update README.md
Frooodle ffe54a1
Merge branch 'main' into changes
Frooodle 0261cef
install custom fonts
Frooodle fb38f7d
Merge branch 'changes' of git@github.com:Stirling-Tools/Stirling-PDF.…
129b675
Formats etc
Frooodle 7cc288b
version bump
Frooodle 3716cb9
disable WIP work
Frooodle e78cd1d
Merge branch 'main' into changes
Frooodle 4c6c9af
remove chinese font
Frooodle 20f07cf
Merge branch 'changes' of git@github.com:Stirling-Tools/Stirling-PDF.…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
|
||
LANGS=$1 | ||
|
||
# Function to install a font package | ||
install_font() { | ||
echo "Installing font package: $1" | ||
if ! apk add "$1" --no-cache; then | ||
echo "Failed to install $1" | ||
fi | ||
} | ||
|
||
# Install common fonts used across many languages | ||
#common_fonts=( | ||
# font-terminus | ||
# font-dejavu | ||
# font-noto | ||
# font-noto-cjk | ||
# font-awesome | ||
# font-noto-extra | ||
#) | ||
# | ||
#for font in "${common_fonts[@]}"; do | ||
# install_font $font | ||
#done | ||
|
||
# Map languages to specific font packages | ||
declare -A language_fonts=( | ||
["ar_AR"]="font-noto-arabic" | ||
["zh_CN"]="font-isas-misc" | ||
["zh_TW"]="font-isas-misc" | ||
["ja_JP"]="font-noto font-noto-thai font-noto-tibetan font-ipa font-sony-misc font-jis-misc" | ||
["ru_RU"]="font-vollkorn font-misc-cyrillic font-mutt-misc font-screen-cyrillic font-winitzki-cyrillic font-cronyx-cyrillic" | ||
["sr_LATN_RS"]="font-vollkorn font-misc-cyrillic font-mutt-misc font-screen-cyrillic font-winitzki-cyrillic font-cronyx-cyrillic" | ||
["uk_UA"]="font-vollkorn font-misc-cyrillic font-mutt-misc font-screen-cyrillic font-winitzki-cyrillic font-cronyx-cyrillic" | ||
["ko_KR"]="font-noto font-noto-thai font-noto-tibetan" | ||
["el_GR"]="font-noto" | ||
["hi_IN"]="font-noto-devanagari" | ||
["bg_BG"]="font-vollkorn font-misc-cyrillic" | ||
["GENERAL"]="font-terminus font-dejavu font-noto font-noto-cjk font-awesome font-noto-extra" | ||
) | ||
|
||
# Install fonts for other languages which generally do not need special packages beyond 'font-noto' | ||
other_langs=("en_GB" "en_US" "de_DE" "fr_FR" "es_ES" "ca_CA" "it_IT" "pt_BR" "nl_NL" "sv_SE" "pl_PL" "ro_RO" "hu_HU" "tr_TR" "id_ID" "eu_ES") | ||
if [[ $LANGS == "ALL" ]]; then | ||
# Install all fonts from the language_fonts map | ||
for fonts in "${language_fonts[@]}"; do | ||
for font in $fonts; do | ||
install_font $font | ||
done | ||
done | ||
else | ||
# Split comma-separated languages and install necessary fonts | ||
IFS=',' read -ra LANG_CODES <<< "$LANGS" | ||
for code in "${LANG_CODES[@]}"; do | ||
if [[ " ${other_langs[@]} " =~ " ${code} " ]]; then | ||
install_font font-noto | ||
else | ||
fonts_to_install=${language_fonts[$code]} | ||
if [ ! -z "$fonts_to_install" ]; then | ||
for font in $fonts_to_install; do | ||
install_font $font | ||
done | ||
fi | ||
fi | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are downloading the cache, never use it and then delete it at the end again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will remove this on next branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just want to remind you that it is still no changed