diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-10-31 12:23:26 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-10-31 12:23:26 +0200 |
commit | 98f5ab5aa00f4d6b83079e6ee4e228b401356198 (patch) | |
tree | 3760877ce19431b821b66ae8b43a9fecea201460 /res | |
parent | a7596f683456da5274ecb33d4043a9eb47858c99 (diff) |
Changed format of resources.lgr
Resources are now stored in a ZIP archive, and it comes with an explicit version number. All the old embed/bincat stuff was removed as unnecessary.
resources.lgr is also a valid fontpack, for loading the built-in fonts.
IssueID #363
Diffstat (limited to 'res')
-rw-r--r-- | res/Fontpack.cmake | 19 | ||||
-rw-r--r-- | res/bincat.c | 48 | ||||
-rwxr-xr-x | res/bincat.sh | 22 | ||||
-rw-r--r-- | res/fontpack.ini (renamed from res/default.fontpack/fontpack.ini) | 22 | ||||
-rw-r--r-- | res/fonts/IosevkaTerm-Extended.ttf (renamed from res/default.fontpack/IosevkaTerm-Extended.ttf) | bin | 1503504 -> 1503504 bytes | |||
-rw-r--r-- | res/fonts/LICENSE_OFL.txt (renamed from res/default.fontpack/LICENSE_OFL.txt) | 0 | ||||
-rw-r--r-- | res/fonts/LICENSE_SmolEmoji.txt (renamed from res/default.fontpack/LICENSE_SmolEmoji.txt) | 0 | ||||
-rw-r--r-- | res/fonts/NotoEmoji-Regular.ttf (renamed from res/default.fontpack/NotoEmoji-Regular.ttf) | bin | 418804 -> 418804 bytes | |||
-rw-r--r-- | res/fonts/NotoSansSymbols-Regular.ttf (renamed from res/default.fontpack/NotoSansSymbols-Regular.ttf) | bin | 168520 -> 168520 bytes | |||
-rw-r--r-- | res/fonts/NotoSansSymbols2-Regular.ttf (renamed from res/default.fontpack/NotoSansSymbols2-Regular.ttf) | bin | 583072 -> 583072 bytes | |||
-rw-r--r-- | res/fonts/SmolEmoji-Regular.ttf (renamed from res/default.fontpack/SmolEmoji-Regular.ttf) | bin | 58544 -> 58544 bytes | |||
-rw-r--r-- | res/fonts/SourceSans3-Bold.ttf (renamed from res/default.fontpack/SourceSans3-Bold.ttf) | bin | 298256 -> 298256 bytes | |||
-rw-r--r-- | res/fonts/SourceSans3-ExtraLight.ttf (renamed from res/default.fontpack/SourceSans3-ExtraLight.ttf) | bin | 293932 -> 293932 bytes | |||
-rw-r--r-- | res/fonts/SourceSans3-It.ttf (renamed from res/default.fontpack/SourceSans3-It.ttf) | bin | 214992 -> 214992 bytes | |||
-rw-r--r-- | res/fonts/SourceSans3-Regular.ttf (renamed from res/default.fontpack/SourceSans3-Regular.ttf) | bin | 299252 -> 299252 bytes | |||
-rw-r--r-- | res/fonts/SourceSans3-Semibold.ttf (renamed from res/default.fontpack/SourceSans3-Semibold.ttf) | bin | 298888 -> 298888 bytes |
16 files changed, 11 insertions, 100 deletions
diff --git a/res/Fontpack.cmake b/res/Fontpack.cmake deleted file mode 100644 index 26d6df1e..00000000 --- a/res/Fontpack.cmake +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | find_program (ZIP_EXECUTABLE zip DOC "ZIP archiver") | ||
2 | if (NOT ZIP_EXECUTABLE) | ||
3 | message (FATAL_ERROR "Please install 'zip' to create fontpacks.") | ||
4 | endif () | ||
5 | |||
6 | function (make_fontpack src) | ||
7 | get_filename_component (dst ${src} NAME) | ||
8 | set (fn ${CMAKE_BINARY_DIR}/${dst}) | ||
9 | execute_process (COMMAND ${CMAKE_COMMAND} -E remove ${fn}) | ||
10 | file (GLOB files RELATIVE ${CMAKE_SOURCE_DIR}/${src} | ||
11 | ${CMAKE_SOURCE_DIR}/${src}/* | ||
12 | ) | ||
13 | message (STATUS " ${src}") | ||
14 | execute_process ( | ||
15 | COMMAND ${ZIP_EXECUTABLE} -0 ${fn} ${files} | ||
16 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/${src} | ||
17 | OUTPUT_QUIET | ||
18 | ) | ||
19 | endfunction () | ||
diff --git a/res/bincat.c b/res/bincat.c deleted file mode 100644 index 8fc9d831..00000000 --- a/res/bincat.c +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* Copyright 2020 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
2 | |||
3 | Redistribution and use in source and binary forms, with or without | ||
4 | modification, are permitted provided that the following conditions are met: | ||
5 | |||
6 | 1. Redistributions of source code must retain the above copyright notice, this | ||
7 | list of conditions and the following disclaimer. | ||
8 | 2. Redistributions in binary form must reproduce the above copyright notice, | ||
9 | this list of conditions and the following disclaimer in the documentation | ||
10 | and/or other materials provided with the distribution. | ||
11 | |||
12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
13 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
14 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
15 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
16 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
17 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
18 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
21 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | ||
22 | |||
23 | /* bincat.c: Tiny tool for concatenating binary files */ | ||
24 | |||
25 | #include <stdio.h> | ||
26 | #include <stdlib.h> | ||
27 | |||
28 | int main(int argc, char *argv[]) { | ||
29 | const size_t bufSize = 1024 * 256; | ||
30 | char *buf = malloc(bufSize); | ||
31 | FILE *out = fopen(argv[1], "wb"); | ||
32 | int i; | ||
33 | for (i = 2; i < argc; ++i) { | ||
34 | FILE *f = fopen(argv[i], "rb"); | ||
35 | size_t fileSize = 0; | ||
36 | for (;;) { | ||
37 | size_t num = fread(buf, 1, bufSize, f); | ||
38 | if (num <= 0) break; | ||
39 | fileSize += num; | ||
40 | fwrite(buf, 1, num, out); | ||
41 | } | ||
42 | fclose(f); | ||
43 | printf("%zu;", fileSize); | ||
44 | } | ||
45 | fclose(out); | ||
46 | free(buf); | ||
47 | return 0; | ||
48 | } | ||
diff --git a/res/bincat.sh b/res/bincat.sh deleted file mode 100755 index eb46655b..00000000 --- a/res/bincat.sh +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # Binary Resource Concatenator | ||
3 | # Copyright: 2021 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
4 | # License: BSD 2-Clause | ||
5 | |||
6 | OUTPUT=-- | ||
7 | SIZES="" | ||
8 | for fn in $*; do | ||
9 | if [ "$OUTPUT" = "--" ]; then | ||
10 | OUTPUT=$fn | ||
11 | rm -f ${OUTPUT} | ||
12 | else | ||
13 | vals=(`/bin/ls -l $fn`) | ||
14 | if [ "$SIZES" = "" ]; then | ||
15 | SIZES=${vals[4]} | ||
16 | else | ||
17 | SIZES=$SIZES\;${vals[4]} | ||
18 | fi | ||
19 | cat ${fn} >> ${OUTPUT} | ||
20 | fi | ||
21 | done | ||
22 | echo $SIZES | ||
diff --git a/res/default.fontpack/fontpack.ini b/res/fontpack.ini index 68316ef6..920a4ad2 100644 --- a/res/default.fontpack/fontpack.ini +++ b/res/fontpack.ini | |||
@@ -19,17 +19,17 @@ | |||
19 | 19 | ||
20 | [default] | 20 | [default] |
21 | name = "Source Sans" | 21 | name = "Source Sans" |
22 | regular = "SourceSans3-Regular.ttf" | 22 | regular = "fonts/SourceSans3-Regular.ttf" |
23 | italic = "SourceSans3-It.ttf" | 23 | italic = "fonts/SourceSans3-It.ttf" |
24 | light = "SourceSans3-ExtraLight.ttf" | 24 | light = "fonts/SourceSans3-ExtraLight.ttf" |
25 | semibold = "SourceSans3-Semibold.ttf" | 25 | semibold = "fonts/SourceSans3-Semibold.ttf" |
26 | bold = "SourceSans3-Bold.ttf" | 26 | bold = "fonts/SourceSans3-Bold.ttf" |
27 | 27 | ||
28 | [iosevka] | 28 | [iosevka] |
29 | name = "Iosevka (compact)" | 29 | name = "Iosevka (compact)" |
30 | monospace = true | 30 | monospace = true |
31 | doc.height = 0.800 | 31 | doc.height = 0.800 |
32 | regular = "IosevkaTerm-Extended.ttf" | 32 | regular = "fonts/IosevkaTerm-Extended.ttf" |
33 | 33 | ||
34 | [iosevka-body] | 34 | [iosevka-body] |
35 | # Variant of Iosevka with expanded line spacing for better readability. | 35 | # Variant of Iosevka with expanded line spacing for better readability. |
@@ -38,21 +38,21 @@ name = "Iosevka" | |||
38 | monospace = true | 38 | monospace = true |
39 | priority = -10 | 39 | priority = -10 |
40 | glyphscale = 0.800 | 40 | glyphscale = 0.800 |
41 | regular = "IosevkaTerm-Extended.ttf" | 41 | regular = "fonts/IosevkaTerm-Extended.ttf" |
42 | 42 | ||
43 | [smolemoji] | 43 | [smolemoji] |
44 | name = "Smol Emoji" | 44 | name = "Smol Emoji" |
45 | override = true # These Emoji/symbols are always preferred. | 45 | override = true # These Emoji/symbols are always preferred. |
46 | auxiliary = true | 46 | auxiliary = true |
47 | priority = 100 | 47 | priority = 100 |
48 | regular = "SmolEmoji-Regular.ttf" | 48 | regular = "fonts/SmolEmoji-Regular.ttf" |
49 | 49 | ||
50 | [notoemoji] | 50 | [notoemoji] |
51 | name = "Noto Emoji" | 51 | name = "Noto Emoji" |
52 | auxiliary = true | 52 | auxiliary = true |
53 | priority = 30 | 53 | priority = 30 |
54 | glyphscale = 1.1 | 54 | glyphscale = 1.1 |
55 | regular = "NotoEmoji-Regular.ttf" | 55 | regular = "fonts/NotoEmoji-Regular.ttf" |
56 | 56 | ||
57 | [notosymbols2] | 57 | [notosymbols2] |
58 | name = "Noto Sans Symbols 2" | 58 | name = "Noto Sans Symbols 2" |
@@ -60,7 +60,7 @@ auxiliary = true | |||
60 | priority = 20 | 60 | priority = 20 |
61 | glyphscale = 1.45 | 61 | glyphscale = 1.45 |
62 | voffset = 0.5 | 62 | voffset = 0.5 |
63 | regular = "NotoSansSymbols2-Regular.ttf" | 63 | regular = "fonts/NotoSansSymbols2-Regular.ttf" |
64 | 64 | ||
65 | [notosymbols] | 65 | [notosymbols] |
66 | name = "Noto Sans Symbols" | 66 | name = "Noto Sans Symbols" |
@@ -68,4 +68,4 @@ auxiliary = true | |||
68 | priority = 10 | 68 | priority = 10 |
69 | glyphscale = 2.0 | 69 | glyphscale = 2.0 |
70 | voffset = 1.2 | 70 | voffset = 1.2 |
71 | regular = "NotoSansSymbols-Regular.ttf" | 71 | regular = "fonts/NotoSansSymbols-Regular.ttf" |
diff --git a/res/default.fontpack/IosevkaTerm-Extended.ttf b/res/fonts/IosevkaTerm-Extended.ttf index 16989a85..16989a85 100644 --- a/res/default.fontpack/IosevkaTerm-Extended.ttf +++ b/res/fonts/IosevkaTerm-Extended.ttf | |||
Binary files differ | |||
diff --git a/res/default.fontpack/LICENSE_OFL.txt b/res/fonts/LICENSE_OFL.txt index d952d62c..d952d62c 100644 --- a/res/default.fontpack/LICENSE_OFL.txt +++ b/res/fonts/LICENSE_OFL.txt | |||
diff --git a/res/default.fontpack/LICENSE_SmolEmoji.txt b/res/fonts/LICENSE_SmolEmoji.txt index 3513b65a..3513b65a 100644 --- a/res/default.fontpack/LICENSE_SmolEmoji.txt +++ b/res/fonts/LICENSE_SmolEmoji.txt | |||
diff --git a/res/default.fontpack/NotoEmoji-Regular.ttf b/res/fonts/NotoEmoji-Regular.ttf index 19b7badf..19b7badf 100644 --- a/res/default.fontpack/NotoEmoji-Regular.ttf +++ b/res/fonts/NotoEmoji-Regular.ttf | |||
Binary files differ | |||
diff --git a/res/default.fontpack/NotoSansSymbols-Regular.ttf b/res/fonts/NotoSansSymbols-Regular.ttf index 68847551..68847551 100644 --- a/res/default.fontpack/NotoSansSymbols-Regular.ttf +++ b/res/fonts/NotoSansSymbols-Regular.ttf | |||
Binary files differ | |||
diff --git a/res/default.fontpack/NotoSansSymbols2-Regular.ttf b/res/fonts/NotoSansSymbols2-Regular.ttf index 79706435..79706435 100644 --- a/res/default.fontpack/NotoSansSymbols2-Regular.ttf +++ b/res/fonts/NotoSansSymbols2-Regular.ttf | |||
Binary files differ | |||
diff --git a/res/default.fontpack/SmolEmoji-Regular.ttf b/res/fonts/SmolEmoji-Regular.ttf index 3ab9484b..3ab9484b 100644 --- a/res/default.fontpack/SmolEmoji-Regular.ttf +++ b/res/fonts/SmolEmoji-Regular.ttf | |||
Binary files differ | |||
diff --git a/res/default.fontpack/SourceSans3-Bold.ttf b/res/fonts/SourceSans3-Bold.ttf index 486ede63..486ede63 100644 --- a/res/default.fontpack/SourceSans3-Bold.ttf +++ b/res/fonts/SourceSans3-Bold.ttf | |||
Binary files differ | |||
diff --git a/res/default.fontpack/SourceSans3-ExtraLight.ttf b/res/fonts/SourceSans3-ExtraLight.ttf index 53e1541c..53e1541c 100644 --- a/res/default.fontpack/SourceSans3-ExtraLight.ttf +++ b/res/fonts/SourceSans3-ExtraLight.ttf | |||
Binary files differ | |||
diff --git a/res/default.fontpack/SourceSans3-It.ttf b/res/fonts/SourceSans3-It.ttf index 9823601c..9823601c 100644 --- a/res/default.fontpack/SourceSans3-It.ttf +++ b/res/fonts/SourceSans3-It.ttf | |||
Binary files differ | |||
diff --git a/res/default.fontpack/SourceSans3-Regular.ttf b/res/fonts/SourceSans3-Regular.ttf index f6d31e8c..f6d31e8c 100644 --- a/res/default.fontpack/SourceSans3-Regular.ttf +++ b/res/fonts/SourceSans3-Regular.ttf | |||
Binary files differ | |||
diff --git a/res/default.fontpack/SourceSans3-Semibold.ttf b/res/fonts/SourceSans3-Semibold.ttf index d4774aab..d4774aab 100644 --- a/res/default.fontpack/SourceSans3-Semibold.ttf +++ b/res/fonts/SourceSans3-Semibold.ttf | |||
Binary files differ | |||