Revert "internals: Support characters beyond the first unicode plane (WIP)"

This reverts commit d05c59f35b.
This commit is contained in:
Solomon Peachy 2025-08-20 16:09:49 -04:00
parent d05c59f35b
commit 84504c7471
44 changed files with 335 additions and 480 deletions

View file

@ -27,7 +27,7 @@
* Sets is_rtl (if it's not NULL) to whether the character
* belongs to an RTL language.
*/
bool is_diacritic(const ucschar_t char_code, bool *is_rtl);
bool is_diacritic(const unsigned short char_code, bool *is_rtl);
/* Note IS_DIACRITIC macros may elide the function call
* therefore there is a separate _RTL version that requires a bool pointer

View file

@ -21,25 +21,24 @@
#ifndef _FONT_CACHE_H_
#define _FONT_CACHE_H_
#include <stdbool.h>
#include "config.h"
#include "lru.h"
/*******************************************************************************
*
*
******************************************************************************/
struct font_cache
{
struct lru _lru;
unsigned int _size;
unsigned int _capacity;
ucschar_t _prev_char_code;
int _size;
int _capacity;
int _prev_char_code;
int _prev_result;
short *_index; /* index of lru handles in char_code order */
};
struct font_cache_entry
{
ucschar_t _char_code;
unsigned short _char_code;
unsigned char width;
unsigned char bitmap[1]; /* place holder */
};
@ -56,7 +55,7 @@ void font_cache_create(
* Note: With cache_only this can return NULL, which otherwise never happens */
struct font_cache_entry* font_cache_get(
struct font_cache* fcache,
ucschar_t char_code,
unsigned short char_code,
bool cache_only,
void (*callback) (struct font_cache_entry* p, void *callback_data),
void *callback_data);

View file

@ -33,7 +33,6 @@ struct lru
void *_base;
};
/* LRU_SLOT_OVERHEAD is the fixed portion of struct lru_node */
#define LRU_SLOT_OVERHEAD (2 * sizeof(short))
/* Create LRU list with specified size from buf. */
@ -46,3 +45,4 @@ void *lru_data(struct lru* pl, short handle);
void lru_traverse(struct lru* pl, void (*callback)(void* data));
#endif /* LRU_H */

View file

@ -27,7 +27,7 @@
*/
#ifndef _RBUNICODE_H_
#define _RBUNICODE_H_
#include "config.h"
#include <stdbool.h>
@ -63,9 +63,8 @@ unsigned char* utf16LEdecode(const unsigned char *utf16, unsigned char *utf8, in
unsigned char* utf16BEdecode(const unsigned char *utf16, unsigned char *utf8, int count);
unsigned char* utf16decode(const unsigned char *utf16, unsigned char *utf8, int count, int utf8_size, bool le);
bool utf16_has_bom(const unsigned char *utf16, bool *le);
unsigned long utf16len_utf8(const unsigned char *utf8);
unsigned long utf8length(const unsigned char *utf8);
const unsigned char* utf8decode(const unsigned char *utf8, ucschar_t *ucs);
const unsigned char* utf8decode(const unsigned char *utf8, unsigned short *ucs);
void set_codepage(int cp);
int get_codepage(void);
int utf8seek(const unsigned char* utf8, int offset);