Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-21 05:33:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-21 05:33:06 +0400
commit6912e94d06edd4c9d099fc3d248aa56ccc7460be (patch)
treecf5eeb6b4cee925fc42209cc8577ab26953df76d /source/blender/blenfont/intern
parent2d8189cec0dab3d4c9db95c03ebb4eb2de6738c4 (diff)
replace BLF's blf_utf8_next() with BLI_str_utf8_as_unicode_step(),
also fixed some spelling errors.
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r--source/blender/blenfont/intern/blf_font.c2
-rw-r--r--source/blender/blenfont/intern/blf_internal.h1
-rw-r--r--source/blender/blenfont/intern/blf_util.c64
3 files changed, 1 insertions, 66 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 9a7fb95dd78..355182fb85f 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -129,7 +129,7 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
g= (glyph_ascii_table)[c]; \
i++; \
} \
- else if ((c= blf_utf8_next((str), &(i))) != BLI_UTF8_ERR) { \
+ else if ((c= BLI_str_utf8_as_unicode_step((str), &(i))) != BLI_UTF8_ERR) { \
if ((g= blf_glyph_search((font)->glyph_cache, c)) == NULL) { \
g= blf_glyph_add(font, FT_Get_Char_Index((font)->face, c), c); \
} \
diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h
index 4c830910e36..df88d0c8fea 100644
--- a/source/blender/blenfont/intern/blf_internal.h
+++ b/source/blender/blenfont/intern/blf_internal.h
@@ -40,7 +40,6 @@ struct rctf;
unsigned int blf_next_p2(unsigned int x);
unsigned int blf_hash(unsigned int val);
-unsigned int blf_utf8_next(const char *buf, size_t *iindex);
char *blf_dir_search(const char *file);
char *blf_dir_metrics_search(const char *filename);
diff --git a/source/blender/blenfont/intern/blf_util.c b/source/blender/blenfont/intern/blf_util.c
index aef97b6f1cc..d51f9b8af6b 100644
--- a/source/blender/blenfont/intern/blf_util.c
+++ b/source/blender/blenfont/intern/blf_util.c
@@ -64,67 +64,3 @@ unsigned int blf_hash(unsigned int val)
key ^= (key >> 17);
return key % 257;
}
-
-/*
- * This function is from Imlib2 library (font_main.c), a
- * library that does image file loading and saving as well
- * as rendering, manipulation, arbitrary polygon support, etc.
- *
- * Copyright (C) 2000 Carsten Haitzler and various contributors
- * The original name: imlib_font_utf8_get_next
- * more info here: http://docs.enlightenment.org/api/imlib2/html/
- */
-unsigned int blf_utf8_next(const char *buf, size_t *iindex)
-{
- /* Reads UTF8 bytes from 'buf', starting at 'index' and
- * returns the code point of the next valid code point.
- * 'index' is updated ready for the next call.
- *
- * Returns 0 to indicate an error (e.g. invalid UTF8)
- */
- int index= *iindex, len, r;
- unsigned char d, d2, d3, d4;
-
- d= buf[index++];
- if (!d)
- return BLI_UTF8_ERR;
-
- while (buf[index] && ((buf[index] & 0xc0) == 0x80))
- index++;
-
- len= index - *iindex;
- if (len == 1)
- r= d;
- else if (len == 2) {
- /* 2 byte */
- d2= buf[*iindex + 1];
- r= d & 0x1f; /* copy lower 5 */
- r <<= 6;
- r |= (d2 & 0x3f); /* copy lower 6 */
- }
- else if (len == 3) {
- /* 3 byte */
- d2= buf[*iindex + 1];
- d3= buf[*iindex + 2];
- r= d & 0x0f; /* copy lower 4 */
- r <<= 6;
- r |= (d2 & 0x3f);
- r <<= 6;
- r |= (d3 & 0x3f);
- }
- else {
- /* 4 byte */
- d2= buf[*iindex + 1];
- d3= buf[*iindex + 2];
- d4= buf[*iindex + 3];
- r= d & 0x0f; /* copy lower 4 */
- r <<= 6;
- r |= (d2 & 0x3f);
- r <<= 6;
- r |= (d3 & 0x3f);
- r <<= 6;
- r |= (d4 & 0x3f);
- }
- *iindex= index;
- return r;
-}