Take const char pointers in lime::Font methods

This commit is contained in:
tobil4sk
2023-04-21 19:11:38 +01:00
parent 79eed06b74
commit 7c9a1894f6
2 changed files with 7 additions and 6 deletions

View File

@@ -49,8 +49,8 @@ namespace lime {
int GetAscender (); int GetAscender ();
int GetDescender (); int GetDescender ();
wchar_t *GetFamilyName (); wchar_t *GetFamilyName ();
int GetGlyphIndex (char* character); int GetGlyphIndex (const char* character);
void* GetGlyphIndices (bool useCFFIValue, char* characters); void* GetGlyphIndices (bool useCFFIValue, const char* characters);
void* GetGlyphMetrics (bool useCFFIValue, int index); void* GetGlyphMetrics (bool useCFFIValue, int index);
int GetHeight (); int GetHeight ();
int GetNumGlyphs (); int GetNumGlyphs ();

View File

@@ -25,7 +25,7 @@
#define IS_IN_RANGE(c, f, l) (((c) >= (f)) && ((c) <= (l))) #define IS_IN_RANGE(c, f, l) (((c) >= (f)) && ((c) <= (l)))
unsigned long readNextChar (char*& p) unsigned long readNextChar (const char*& p)
{ {
// TODO: since UTF-8 is a variable-length // TODO: since UTF-8 is a variable-length
// encoding, you should pass in the input // encoding, you should pass in the input
@@ -33,7 +33,8 @@ unsigned long readNextChar (char*& p)
// can determine if a malformed UTF-8 // can determine if a malformed UTF-8
// sequence would exceed the end of the buffer... // sequence would exceed the end of the buffer...
unsigned char c1, c2, *ptr = (unsigned char*) p; const unsigned char* ptr = (const unsigned char*) p;
unsigned char c1, c2;
unsigned long uc = 0; unsigned long uc = 0;
int seqlen; int seqlen;
@@ -792,7 +793,7 @@ namespace lime {
} }
int Font::GetGlyphIndex (char* character) { int Font::GetGlyphIndex (const char* character) {
long charCode = readNextChar (character); long charCode = readNextChar (character);
@@ -801,7 +802,7 @@ namespace lime {
} }
void* Font::GetGlyphIndices (bool useCFFIValue, char* characters) { void* Font::GetGlyphIndices (bool useCFFIValue, const char* characters) {
if (useCFFIValue) { if (useCFFIValue) {