summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-24 08:18:34 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-24 08:18:34 +0200
commit8f2425125e79240d2ff9161297438b4012de826f (patch)
treec978b7cad959ecfea50ff388102eacf629691e40
parent22d877843782086da2c0e12495f13f6c4bc6b4f7 (diff)
downloadserenity-8f2425125e79240d2ff9161297438b4012de826f.zip
LibGfx+Base: Tweak bitmap fonts to ensure glyph data is 4-byte aligned
When building userland with UBSAN enabled (#7434), we were getting spammed to death by unaligned access errors. Fix these by adding 2 bytes of padding to the FontFileHeader struct, and adjusting all our font files to match the new format. :^)
-rw-r--r--Base/res/fonts/CsillaBold10.fontbin15822 -> 15824 bytes
-rw-r--r--Base/res/fonts/CsillaBold12.fontbin18894 -> 18896 bytes
-rw-r--r--Base/res/fonts/CsillaRegular10.fontbin52558 -> 52560 bytes
-rw-r--r--Base/res/fonts/CsillaRegular12.fontbin18894 -> 18896 bytes
-rw-r--r--Base/res/fonts/KaticaBold10.fontbin63054 -> 63056 bytes
-rw-r--r--Base/res/fonts/KaticaBold12.fontbin20430 -> 20432 bytes
-rw-r--r--Base/res/fonts/KaticaRegular10.fontbin63054 -> 63056 bytes
-rw-r--r--Base/res/fonts/KaticaRegular12.fontbin20430 -> 20432 bytes
-rw-r--r--Base/res/fonts/LizaBlack10.fontbin15822 -> 15824 bytes
-rw-r--r--Base/res/fonts/LizaBlack24.fontbin37326 -> 37328 bytes
-rw-r--r--Base/res/fonts/LizaBlack36.fontbin55758 -> 55760 bytes
-rw-r--r--Base/res/fonts/LizaBold10.fontbin15822 -> 15824 bytes
-rw-r--r--Base/res/fonts/LizaBold24.fontbin37326 -> 37328 bytes
-rw-r--r--Base/res/fonts/LizaBold36.fontbin55758 -> 55760 bytes
-rw-r--r--Base/res/fonts/LizaRegular10.fontbin15822 -> 15824 bytes
-rw-r--r--Base/res/fonts/LizaRegular24.fontbin37326 -> 37328 bytes
-rw-r--r--Base/res/fonts/LizaRegular36.fontbin55758 -> 55760 bytes
-rw-r--r--Base/res/fonts/MarietaBold24.fontbin24910 -> 24912 bytes
-rw-r--r--Base/res/fonts/MarietaBold36.fontbin37198 -> 37200 bytes
-rw-r--r--Base/res/fonts/MarietaRegular24.fontbin24910 -> 24912 bytes
-rw-r--r--Base/res/fonts/MarietaRegular36.fontbin37198 -> 37200 bytes
-rw-r--r--Base/res/fonts/PebbletonBold14.fontbin21966 -> 21968 bytes
-rw-r--r--Base/res/fonts/PebbletonRegular14.fontbin21966 -> 21968 bytes
-rw-r--r--Userland/Libraries/LibGfx/BitmapFont.cpp3
24 files changed, 3 insertions, 0 deletions
diff --git a/Base/res/fonts/CsillaBold10.font b/Base/res/fonts/CsillaBold10.font
index a69c20761a..f6ac94a81b 100644
--- a/Base/res/fonts/CsillaBold10.font
+++ b/Base/res/fonts/CsillaBold10.font
Binary files differ
diff --git a/Base/res/fonts/CsillaBold12.font b/Base/res/fonts/CsillaBold12.font
index 0bd7090a73..39d96b4aa3 100644
--- a/Base/res/fonts/CsillaBold12.font
+++ b/Base/res/fonts/CsillaBold12.font
Binary files differ
diff --git a/Base/res/fonts/CsillaRegular10.font b/Base/res/fonts/CsillaRegular10.font
index 6e5815f9bc..090f2f265b 100644
--- a/Base/res/fonts/CsillaRegular10.font
+++ b/Base/res/fonts/CsillaRegular10.font
Binary files differ
diff --git a/Base/res/fonts/CsillaRegular12.font b/Base/res/fonts/CsillaRegular12.font
index bd52e33142..cd367a3f1e 100644
--- a/Base/res/fonts/CsillaRegular12.font
+++ b/Base/res/fonts/CsillaRegular12.font
Binary files differ
diff --git a/Base/res/fonts/KaticaBold10.font b/Base/res/fonts/KaticaBold10.font
index efba786f18..9ff2641f8b 100644
--- a/Base/res/fonts/KaticaBold10.font
+++ b/Base/res/fonts/KaticaBold10.font
Binary files differ
diff --git a/Base/res/fonts/KaticaBold12.font b/Base/res/fonts/KaticaBold12.font
index 831ee25d1a..b468c9d44b 100644
--- a/Base/res/fonts/KaticaBold12.font
+++ b/Base/res/fonts/KaticaBold12.font
Binary files differ
diff --git a/Base/res/fonts/KaticaRegular10.font b/Base/res/fonts/KaticaRegular10.font
index 21e2fb5521..bf4e9ac27b 100644
--- a/Base/res/fonts/KaticaRegular10.font
+++ b/Base/res/fonts/KaticaRegular10.font
Binary files differ
diff --git a/Base/res/fonts/KaticaRegular12.font b/Base/res/fonts/KaticaRegular12.font
index 2f23e5f059..92543ea33c 100644
--- a/Base/res/fonts/KaticaRegular12.font
+++ b/Base/res/fonts/KaticaRegular12.font
Binary files differ
diff --git a/Base/res/fonts/LizaBlack10.font b/Base/res/fonts/LizaBlack10.font
index 1cd3047606..07ce71144d 100644
--- a/Base/res/fonts/LizaBlack10.font
+++ b/Base/res/fonts/LizaBlack10.font
Binary files differ
diff --git a/Base/res/fonts/LizaBlack24.font b/Base/res/fonts/LizaBlack24.font
index 763cdbce3d..400da329bf 100644
--- a/Base/res/fonts/LizaBlack24.font
+++ b/Base/res/fonts/LizaBlack24.font
Binary files differ
diff --git a/Base/res/fonts/LizaBlack36.font b/Base/res/fonts/LizaBlack36.font
index 05c9fe5ab0..06cdc8e59b 100644
--- a/Base/res/fonts/LizaBlack36.font
+++ b/Base/res/fonts/LizaBlack36.font
Binary files differ
diff --git a/Base/res/fonts/LizaBold10.font b/Base/res/fonts/LizaBold10.font
index 7ee0a363a1..292a30bc61 100644
--- a/Base/res/fonts/LizaBold10.font
+++ b/Base/res/fonts/LizaBold10.font
Binary files differ
diff --git a/Base/res/fonts/LizaBold24.font b/Base/res/fonts/LizaBold24.font
index 05f3a3f438..828fc1fff7 100644
--- a/Base/res/fonts/LizaBold24.font
+++ b/Base/res/fonts/LizaBold24.font
Binary files differ
diff --git a/Base/res/fonts/LizaBold36.font b/Base/res/fonts/LizaBold36.font
index 9a14fc4112..eb3a0bfe15 100644
--- a/Base/res/fonts/LizaBold36.font
+++ b/Base/res/fonts/LizaBold36.font
Binary files differ
diff --git a/Base/res/fonts/LizaRegular10.font b/Base/res/fonts/LizaRegular10.font
index 8f355d050a..07d9817fd0 100644
--- a/Base/res/fonts/LizaRegular10.font
+++ b/Base/res/fonts/LizaRegular10.font
Binary files differ
diff --git a/Base/res/fonts/LizaRegular24.font b/Base/res/fonts/LizaRegular24.font
index cd1402432d..34166ef6c1 100644
--- a/Base/res/fonts/LizaRegular24.font
+++ b/Base/res/fonts/LizaRegular24.font
Binary files differ
diff --git a/Base/res/fonts/LizaRegular36.font b/Base/res/fonts/LizaRegular36.font
index 6ff5fca2d8..a6abb1ee01 100644
--- a/Base/res/fonts/LizaRegular36.font
+++ b/Base/res/fonts/LizaRegular36.font
Binary files differ
diff --git a/Base/res/fonts/MarietaBold24.font b/Base/res/fonts/MarietaBold24.font
index d9ba2f19d4..4948313eb7 100644
--- a/Base/res/fonts/MarietaBold24.font
+++ b/Base/res/fonts/MarietaBold24.font
Binary files differ
diff --git a/Base/res/fonts/MarietaBold36.font b/Base/res/fonts/MarietaBold36.font
index 24d6990fda..e6f9a3a845 100644
--- a/Base/res/fonts/MarietaBold36.font
+++ b/Base/res/fonts/MarietaBold36.font
Binary files differ
diff --git a/Base/res/fonts/MarietaRegular24.font b/Base/res/fonts/MarietaRegular24.font
index abeb38a568..d80ed4dc28 100644
--- a/Base/res/fonts/MarietaRegular24.font
+++ b/Base/res/fonts/MarietaRegular24.font
Binary files differ
diff --git a/Base/res/fonts/MarietaRegular36.font b/Base/res/fonts/MarietaRegular36.font
index 850fce272c..6038115b9d 100644
--- a/Base/res/fonts/MarietaRegular36.font
+++ b/Base/res/fonts/MarietaRegular36.font
Binary files differ
diff --git a/Base/res/fonts/PebbletonBold14.font b/Base/res/fonts/PebbletonBold14.font
index 4bdfb0eee9..6ccce1d950 100644
--- a/Base/res/fonts/PebbletonBold14.font
+++ b/Base/res/fonts/PebbletonBold14.font
Binary files differ
diff --git a/Base/res/fonts/PebbletonRegular14.font b/Base/res/fonts/PebbletonRegular14.font
index 3ec8335390..6a15c0b090 100644
--- a/Base/res/fonts/PebbletonRegular14.font
+++ b/Base/res/fonts/PebbletonRegular14.font
Binary files differ
diff --git a/Userland/Libraries/LibGfx/BitmapFont.cpp b/Userland/Libraries/LibGfx/BitmapFont.cpp
index a50ba1b454..a8b844f359 100644
--- a/Userland/Libraries/LibGfx/BitmapFont.cpp
+++ b/Userland/Libraries/LibGfx/BitmapFont.cpp
@@ -35,8 +35,11 @@ struct [[gnu::packed]] FontFileHeader {
u16 weight;
char name[32];
char family[32];
+ u16 unused;
};
+static_assert(sizeof(FontFileHeader) == 80);
+
NonnullRefPtr<Font> BitmapFont::clone() const
{
size_t bytes_per_glyph = sizeof(u32) * glyph_height();