All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andrei Gherzan" <andrei@gherzan.ro>
To: yocto@yoctoproject.org
Cc: David Steinberg <david@sonabuzz.com>
Subject: [psplash][PATCH 1/3] Support --with-font configure option to use other font headers
Date: Tue, 17 Dec 2019 10:22:35 +0000	[thread overview]
Message-ID: <20191217102237.29511-1-andrei@gherzan.ro> (raw)

From: David Steinberg <david@sonabuzz.com>

Signed-off-by: David Steinberg <david@sonabuzz.com>
---
 Makefile.am  | 4 ++--
 configure.ac | 6 ++++++
 psplash.c    | 6 +++---
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a14152a..3721a6e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,11 @@
 bin_PROGRAMS=psplash psplash-write
 
-AM_CFLAGS = $(GCC_FLAGS) -D_GNU_SOURCE
+AM_CFLAGS = $(GCC_FLAGS) -D_GNU_SOURCE -DFONT_HEADER=\"$(FONT_NAME)-font.h\" -DFONT_DEF=$(FONT_NAME)_font
 
 psplash_SOURCES = psplash.c psplash.h psplash-fb.c psplash-fb.h \
                   psplash-console.c psplash-console.h           \
 		  psplash-colors.h psplash-config.h		\
-		  psplash-poky-img.h psplash-bar-img.h radeon-font.h
+		  psplash-poky-img.h psplash-bar-img.h $(FONT_NAME)-font.h
 
 psplash_write_SOURCES = psplash-write.c psplash.h
 
diff --git a/configure.ac b/configure.ac
index 1c4d919..9e78ac0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,6 +14,12 @@ fi
 
 AC_SUBST(GCC_FLAGS)
 
+AC_ARG_WITH([font],
+    AS_HELP_STRING([--with-font], [Set font to use (default is 'radeon')]),
+    [FONT_NAME=$withval],
+    [FONT_NAME=radeon])
+AC_SUBST([FONT_NAME])
+
 AC_OUTPUT([
 Makefile
 ])
diff --git a/psplash.c b/psplash.c
index 992e199..f6442f1 100644
--- a/psplash.c
+++ b/psplash.c
@@ -23,7 +23,7 @@
 #include "psplash-colors.h"
 #include "psplash-poky-img.h"
 #include "psplash-bar-img.h"
-#include "radeon-font.h"
+#include FONT_HEADER
 
 #define SPLIT_LINE_POS(fb)                                  \
 	(  (fb)->height                                     \
@@ -45,7 +45,7 @@ psplash_draw_msg (PSplashFB *fb, const char *msg)
 {
   int w, h;
 
-  psplash_fb_text_size (&w, &h, &radeon_font, msg);
+  psplash_fb_text_size (&w, &h, &FONT_DEF, msg);
 
   DBG("displaying '%s' %ix%i\n", msg, w, h);
 
@@ -62,7 +62,7 @@ psplash_draw_msg (PSplashFB *fb, const char *msg)
 			(fb->width-w)/2, 
 			SPLIT_LINE_POS(fb) - h,
 			PSPLASH_TEXT_COLOR,
-			&radeon_font,
+			&FONT_DEF,
 			msg);
 }
 
-- 
2.17.1


             reply	other threads:[~2019-12-17 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 10:22 Andrei Gherzan [this message]
2019-12-17 10:22 ` [psplash][PATCH 2/3] Double buffering support Andrei Gherzan
2019-12-17 10:22 ` [psplash][PATCH 3/3] Add configure flags for fullscreen logo and no startup message Andrei Gherzan
2020-01-15 18:06 ` [psplash][PATCH 1/3] Support --with-font configure option to use other font headers Andrei Gherzan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191217102237.29511-1-andrei@gherzan.ro \
    --to=andrei@gherzan.ro \
    --cc=david@sonabuzz.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.