aboutsummaryrefslogtreecommitdiffstats
path: root/Lessons/Lesson_52
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2021-11-09 15:05:28 +0300
committerKonstantin Aladyshev <aladyshev22@gmail.com>2021-11-09 15:05:28 +0300
commit4bb8a76753cbc9c5158e2269f9d911a0960d5f03 (patch)
tree24ee6cc2b86448edc28c9f4f01f92764414fc2a7 /Lessons/Lesson_52
parent45cbb1e2ea5c27e27906b70a08af32036964c6a2 (diff)
downloadUEFI-Lessons-4bb8a76753cbc9c5158e2269f9d911a0960d5f03.tar.gz
UEFI-Lessons-4bb8a76753cbc9c5158e2269f9d911a0960d5f03.tar.bz2
UEFI-Lessons-4bb8a76753cbc9c5158e2269f9d911a0960d5f03.zip
Add information about default font
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'Lessons/Lesson_52')
-rw-r--r--Lessons/Lesson_52/README.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/Lessons/Lesson_52/README.md b/Lessons/Lesson_52/README.md
index 2ab4d34..93376ad 100644
--- a/Lessons/Lesson_52/README.md
+++ b/Lessons/Lesson_52/README.md
@@ -168,6 +168,31 @@ For example wide `A` can be something like this:
},
```
+# Default font glyphs
+
+In case you wonder where default font is defined look at the https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/LaffStd.c:
+```
+EFI_NARROW_GLYPH gUsStdNarrowGlyphData[] = {
+ { 0x0020, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ { 0x0021, 0x00, {0x00,0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00}},
+ { 0x0022, 0x00, {0x00,0x00,0x00,0x6C,0x6C,0x6C,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ ...
+ { 0x0000, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} //EOL
+};
+
+// Get available Unicode glyphs narrow fonts(8*19 pixels) size.
+UINT32 mNarrowFontSize = sizeof (gUsStdNarrowGlyphData);
+```
+
+This `gUsStdNarrowGlyphData` array is used to create a font package and register it in the HII database. For the actual code look at the `RegisterFontPackage` function in the file https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
+
+When we investigated package lists in the HII database this was the one responsible for this font:
+```
+PackageList[10]: GUID=F5F219D3-7006-4648-AC8D-D61DFB7BC6AD; size=0x14EC // mFontPackageListGuid
+ Package[0]: type=SIMPLE_FONTS; size=0x14D4
+ Package[1]: type=END; size=0x4
+```
+
# Get Glyph data for the Russian font
Honestly getting the Glyph data is a hardest part for adding a font.