Add support for Tom Thumb small mono-space font

This commit is contained in:
Alan Carvalho de Assis
2017-01-03 11:11:47 -06:00
committed by Gregory Nutt
parent 6889171d7f
commit 6c826bb209
9 changed files with 877 additions and 19 deletions
+7
View File
@@ -555,6 +555,13 @@ config NXFONT_X11_MISC_FIXED_10X20
This option enables support for a "x11-misc-fixed-10x20". This option enables support for a "x11-misc-fixed-10x20".
(font ID FONTID_X11_MISC_FIXED_10X20 == 42). (font ID FONTID_X11_MISC_FIXED_10X20 == 42).
config NXFONT_TOM_THUMB_3X6
bool "Tom Thumb Monospace 3x6"
default n
---help---
This option enables support for a small, 3x5 font.
(font ID FONTID_TOM_THUMB_3X6 == 43).
endmenu endmenu
menuconfig NXTERM menuconfig NXTERM
+11 -1
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* include/nuttx/nx/nxfonts.h * include/nuttx/nx/nxfonts.h
* *
* Copyright (C) 2008, 2009, 2011, 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2008, 2009, 2011, 2015, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,7 @@
/**************************************************************************** /****************************************************************************
* Pre-processor definitions * Pre-processor definitions
****************************************************************************/ ****************************************************************************/
/* Select the default font. If no fonts are selected, then a compilation /* Select the default font. If no fonts are selected, then a compilation
* error is likely down the road. * error is likely down the road.
*/ */
@@ -194,6 +195,11 @@
#elif defined(CONFIG_NXFONT_MONO5X8) #elif defined(CONFIG_NXFONT_MONO5X8)
# define NXFONT_DEFAULT FONTID_MONO5X8 # define NXFONT_DEFAULT FONTID_MONO5X8
/* Tom Thumb mono-space 3x6 font */
#elif defined(CONFIG_NXFONT_TOM_THUMB_3X6)
# define NXFONT_DEFAULT FONTID_TOM_THUMB_3X6
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -387,6 +393,10 @@ enum nx_fontid_e
#ifdef CONFIG_NXFONT_X11_MISC_FIXED_10X20 #ifdef CONFIG_NXFONT_X11_MISC_FIXED_10X20
, FONTID_X11_MISC_FIXED_10X20 = 42 /* X11 misc fixed 10x20 */ , FONTID_X11_MISC_FIXED_10X20 = 42 /* X11 misc fixed 10x20 */
#endif #endif
#ifdef CONFIG_NXFONT_TOM_THUMB_3X6
, FONTID_TOM_THUMB_3X6 = 43 /* Tom Thumb monospace 3x6 */
#endif
}; };
/* This structures provides the metrics for one glyph */ /* This structures provides the metrics for one glyph */
+4
View File
@@ -225,6 +225,10 @@ ifeq ($(CONFIG_NXFONT_X11_MISC_FIXED_10X20),y)
$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=42 EXTRADEFINES=$(EXTRADEFINES) $(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=42 EXTRADEFINES=$(EXTRADEFINES)
endif endif
ifeq ($(CONFIG_NXFONT_TOM_THUMB_3X6),y)
$(Q) $(MAKE) -C nxfonts -f Makefile.sources TOPDIR=$(TOPDIR) NXFONTS_FONTID=43 EXTRADEFINES=$(EXTRADEFINES)
endif
gensources: gen1bppsources gen2bppsource gen4bppsource gen8bppsource gen16bppsource gen24bppsource gen32bppsources genfontsources gensources: gen1bppsources gen2bppsource gen4bppsource gen8bppsource gen16bppsource gen24bppsource gen32bppsources genfontsources
$(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S $(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S
+5 -1
View File
@@ -1,7 +1,7 @@
############################################################################ ############################################################################
# libnx/nxfonts/Make.defs # libnx/nxfonts/Make.defs
# #
# Copyright (C) 2008, 2013 Gregory Nutt. All rights reserved. # Copyright (C) 2008, 2013, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -225,7 +225,11 @@ ifeq ($(CONFIG_NXFONT_X11_MISC_FIXED_10X20),y)
CSRCS += nxfonts_bitmaps_x11-misc-fixed-10x20.c CSRCS += nxfonts_bitmaps_x11-misc-fixed-10x20.c
endif endif
# Tom Thumb mono-space 3x6 font
ifeq ($(CONFIG_NXFONT_TOM_THUMB_3X6),y)
CSRCS += nxfonts_tom-thumb-3x6.c
endif
# Add the nxfont/ directory to the build # Add the nxfont/ directory to the build
+7 -1
View File
@@ -1,7 +1,7 @@
############################################################################ ############################################################################
# libnx/nxfonts/Makefile.sources # libnx/nxfonts/Makefile.sources
# #
# Copyright (C) 2008, 2013 Gregory Nutt. All rights reserved. # Copyright (C) 2008, 2013, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -296,6 +296,12 @@ NXFONTS_PREFIX := g_x11_misc_fixed_10x20_
GEN_CSRC = nxfonts_bitmaps_x11-misc-fixed-10x20.c GEN_CSRC = nxfonts_bitmaps_x11-misc-fixed-10x20.c
endif endif
# Tom Thumb mono-space 3x6 font
ifeq ($(NXFONTS_FONTID),43)
NXFONTS_PREFIX := g_tom_thumb_3x6_
GEN_CSRC = nxfonts_tom-thumb-3x6.c
endif
DEPENDENCY := nxfonts_bitmaps.c DEPENDENCY := nxfonts_bitmaps.c
CPPFLAGS += -DNXFONTS_FONTID=$(NXFONTS_FONTID) CPPFLAGS += -DNXFONTS_FONTID=$(NXFONTS_FONTID)
+2 -5
View File
@@ -54,10 +54,6 @@
# define CONFIG_NXFONTS_CHARBITS 7 # define CONFIG_NXFONTS_CHARBITS 7
#endif #endif
/****************************************************************************
* Public Types
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Data * Public Data
****************************************************************************/ ****************************************************************************/
@@ -65,7 +61,8 @@
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
# define EXTERN extern "C" # define EXTERN extern "C"
extern "C" { extern "C"
{
#else #else
# define EXTERN extern # define EXTERN extern
#endif #endif
+2
View File
@@ -130,6 +130,8 @@
# include "nxfonts_x11-misc-fixed-9x18B.h" # include "nxfonts_x11-misc-fixed-9x18B.h"
#elif NXFONTS_FONTID == 42 #elif NXFONTS_FONTID == 42
# include "nxfonts_x11-misc-fixed-10x20.h" # include "nxfonts_x11-misc-fixed-10x20.h"
#elif NXFONTS_FONTID == 43
# include "nxfonts_tom-thumb-3x6.h"
#else #else
# error "No font ID specified" # error "No font ID specified"
#endif #endif
+12 -11
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* libnx/nxfonts/nxfonts_getfont.c * libnx/nxfonts/nxfonts_getfont.c
* *
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009, 2011, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -49,15 +49,7 @@
#include "nxfonts.h" #include "nxfonts.h"
/**************************************************************************** /****************************************************************************
* Pre-Processor Definitions * Public Data
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/ ****************************************************************************/
/* MONO */ /* MONO */
@@ -246,9 +238,12 @@ extern const struct nx_fontpackage_s g_x11_misc_fixed_9x18B_package;
extern const struct nx_fontpackage_s g_x11_misc_fixed_10x20_package; extern const struct nx_fontpackage_s g_x11_misc_fixed_10x20_package;
#endif #endif
#ifdef CONFIG_NXFONT_TOM_THUMB_3X6
extern const struct nx_fontpackage_s g_tom_thumb_3x6_package;
#endif
static FAR const struct nx_fontpackage_s *g_fontpackages[] = static FAR const struct nx_fontpackage_s *g_fontpackages[] =
{ {
/* MONO */ /* MONO */
#ifdef CONFIG_NXFONT_MONO5X8 #ifdef CONFIG_NXFONT_MONO5X8
@@ -431,6 +426,12 @@ static FAR const struct nx_fontpackage_s *g_fontpackages[] =
&g_x11_misc_fixed_10x20_package, &g_x11_misc_fixed_10x20_package,
#endif #endif
/* Tom Thumb mono-space 3x6 font */
#ifdef CONFIG_NXFONT_TOM_THUMB_3X6
&g_tom_thumb_3x6_package,
#endif
NULL NULL
}; };
File diff suppressed because it is too large Load Diff