diff options
-rw-r--r-- | Lessons/Lesson_52/README.md | 25 |
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. |