diff --git a/apg_pixfont/apg_pixfont.c b/apg_pixfont/apg_pixfont.c index 6b0288f..d5560ed 100644 --- a/apg_pixfont/apg_pixfont.c +++ b/apg_pixfont/apg_pixfont.c @@ -1,4 +1,4 @@ -/* apg_pixfont - C Pixel Font Utility v0.4.3 +/* apg_pixfont - C Pixel Font Utility v0.4.4 C99 Implementation See header file for licence and instructions. Anton Gerdelan 2019 @@ -250,11 +250,12 @@ static bool _is_img_idx_coloured( const unsigned char* image, int idx, int n_cha return false; } -// NOTE(Anton) could also user-specify an outline colour rather than all zero +// Outline is dark rather than black so it can match text colour e.g. in a shader multiplication. +// And so that in e.g. a 1-channel image it can be differentiated from the background. static void _apply_outline( unsigned char* image, int idx, int n_channels ) { - for ( int c = 0; c < n_channels; c++ ) { image[idx * n_channels + c] = 0x00; } - if ( 2 == n_channels ) { image[idx * n_channels + 1] = 0xFF; } // don't set alpha to 0 - if ( 4 == n_channels ) { image[idx * n_channels + 3] = 0xFF; } // don't set alpha to 0 + for ( int c = 0; c < n_channels; c++ ) { image[idx * n_channels + c] = 0x33; } + if ( 2 == n_channels ) { image[idx * n_channels + 1] = 0xFF; } // Don't set alpha to 0. + if ( 4 == n_channels ) { image[idx * n_channels + 3] = 0xFF; } // Don't set alpha to 0. } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/apg_pixfont/apg_pixfont.h b/apg_pixfont/apg_pixfont.h index ea98c5b..cdeed9d 100644 --- a/apg_pixfont/apg_pixfont.h +++ b/apg_pixfont/apg_pixfont.h @@ -90,6 +90,7 @@ Technical Details: History: ============================================================== +0.4.4 - 2024 Oct 18 - Outline is now a darker shade of text colour, not black. 0.4.0 - 2024 Jun 15 - Most of Latin-1 character set included. 0.3.0 - 2023 Mar 09 - Bold/italic/underline/strikethrough style. '\n's at the end of strings trimmed. Atlas generation tools. Basic Unicode UTF-8 support. 0.2.1 - 2022 Sep 26 - Readme correction.