From 91fe324c7217c4a4971f8ceeddaf7999cd4408d8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 3 Jan 2017 12:26:13 -0600 Subject: [PATCH] apps/examples/nxtext: Make line spacing configurable. --- examples/nxtext/Kconfig | 9 +++++++++ examples/nxtext/nxtext_internal.h | 11 +++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/examples/nxtext/Kconfig b/examples/nxtext/Kconfig index b93da3f30..b4775eceb 100644 --- a/examples/nxtext/Kconfig +++ b/examples/nxtext/Kconfig @@ -46,6 +46,15 @@ config EXAMPLES_NXTEXT_GLCACHE ---help--- Size of the glyph cache. +config EXAMPLES_NXTEXT_LINESPACING + int "Line spacing" + default 2 + range 0 4 + ---help--- + The vertical distance between lines is the sum of (1) the vertical + bounding box dimension of the font, and (2) this additional line + space. This value may be zero, but not negative. + comment "Example Color Configuration" config EXAMPLES_NXTEXT_DEFAULT_COLORS diff --git a/examples/nxtext/nxtext_internal.h b/examples/nxtext/nxtext_internal.h index 9f535de46..dc073446c 100644 --- a/examples/nxtext/nxtext_internal.h +++ b/examples/nxtext/nxtext_internal.h @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nxtext/nxtext_internal.h * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -63,6 +63,14 @@ # define CONFIG_EXAMPLES_NXTEXT_VPLANE 0 #endif +/* Line spacing. Space (in rows) between lines. */ + +#ifdef CONFIG_EXAMPLES_NXTEXT_LINESPACING +# define LINE_SEPARATION CONFIG_EXAMPLES_NXTEXT_LINESPACING +#else +# define LINE_SEPARATION 2 +#endif + /* Pixel depth. If none provided, pick the smallest enabled pixel depth */ #ifndef CONFIG_EXAMPLES_NXTEXT_BPP @@ -192,7 +200,6 @@ /* Sizes and maximums */ #define MAX_USECNT 255 /* Limit to range of a uint8_t */ -#define LINE_SEPARATION 2 /* Space (in rows) between lines */ /**************************************************************************** * Public Types