1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/linux/hotfix-fbcon-fonts.patch
3 # Copyright (C) 2024 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 diff --git a/lib/fonts/fonts.c b/lib/fonts/fonts.c
15 index 47e34950b665..efc3efabae79 100644
16 --- a/lib/fonts/fonts.c
17 +++ b/lib/fonts/fonts.c
18 @@ -108,6 +108,10 @@ EXPORT_SYMBOL(find_font);
23 +#define TARGET_XRES 100
24 +#define TARGET_YRES 25
26 const struct font_desc *get_default_font(int xres, int yres,
27 unsigned long *font_w,
28 unsigned long *font_h)
29 @@ -116,9 +120,10 @@ const struct font_desc *get_default_font(int xres, int yres,
30 const struct font_desc *f, *g;
35 for (i = 0; i < num_fonts; i++) {
39 #if defined(__mc68000__)
40 #ifdef CONFIG_FONT_PEARL_8x8
41 @@ -137,12 +142,15 @@ const struct font_desc *get_default_font(int xres, int yres,
42 res = (xres / f->width) * (yres / f->height) / 1000;
46 + /* closest to ideal target res - TODO: maybe add yres */
47 + c = abs(TARGET_XRES - xres / f->width);
49 if ((!font_w || test_bit(f->width - 1, font_w)) &&
50 (!font_h || test_bit(f->height - 1, font_h)))