From 4bb8a76753cbc9c5158e2269f9d911a0960d5f03 Mon Sep 17 00:00:00 2001 From: Konstantin Aladyshev Date: Tue, 9 Nov 2021 15:05:28 +0300 Subject: Add information about default font Signed-off-by: Konstantin Aladyshev --- Lessons/Lesson_52/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Lessons/Lesson_52') 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. -- cgit v1.2.3-18-g5258