diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Font.H | 4 | ||||
| -rw-r--r-- | src/fl_font_mac.cxx | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/Fl_Font.H b/src/Fl_Font.H index 75478b626..950d2e3b0 100644 --- a/src/Fl_Font.H +++ b/src/Fl_Font.H @@ -63,8 +63,8 @@ public: ATSUTextLayout layout; # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 CTFontRef fontref; - // the unicode span is divided in 256 blocks of 256 characters - float *width[256]; // array of arrays of character widths + // the unicode span is divided in 512 blocks of 128 characters + float *width[512]; // array of arrays of character widths # endif ATSUStyle style; short ascent, descent, q_width; diff --git a/src/fl_font_mac.cxx b/src/fl_font_mac.cxx index 291647086..10285129b 100644 --- a/src/fl_font_mac.cxx +++ b/src/fl_font_mac.cxx @@ -312,15 +312,15 @@ if (fl_mac_os_version >= 0x1050) { i++; // because a pair of UniChar's represent a single character continue; } - unsigned int r = uni >> 8; // index of the character block containing uni + unsigned int r = uni >> 7; // index of the character block containing uni if (!fl_fontsize->width[r]) { // this character block has not been hit yet //fprintf(stderr,"r=%d size=%d name=%s\n",r,fl_fontsize->size, fl_fontsize->q_name); // allocate memory to hold width of each character in the block - fl_fontsize->width[r] = (float*) malloc(sizeof(float) * 0x100); - UniChar ii = r * 0x100; + fl_fontsize->width[r] = (float*) malloc(sizeof(float) * 0x80); + UniChar ii = r * 0x80; CGGlyph glyph; CGSize advance_size; - for (int j = 0; j < 0x100; j++) { // loop over the block + for (int j = 0; j < 0x80; j++) { // loop over the block CTFontRef font2 = fl_fontsize->fontref; bool must_release = false; // ii spans all characters of this block @@ -342,7 +342,7 @@ if (fl_mac_os_version >= 0x1050) { } } // sum the widths of all characters of txt - retval += fl_fontsize->width[r][uni & 0xFF]; + retval += fl_fontsize->width[r][uni & 0x7F]; } return retval; } else { |
