Changeset 7659079


Ignore:
Timestamp:
Feb 26, 2011, 12:57:17 AM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
237d02c
Parents:
fb6e8e3
git-author:
David Benjamin <davidben@mit.edu> (02/25/11 15:14:41)
git-committer:
David Benjamin <davidben@mit.edu> (02/26/11 00:57:17)
Message:
Don't precompute UTF-8 encodings of format characters

GString can append gunichar just fine.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r1137802 r7659079  
    5050
    5151  /* Reset attributes */
    52   if (bg) g_string_append(f->buff, OWL_FMTEXT_UTF8_BGDEFAULT);
    53   if (fg) g_string_append(f->buff, OWL_FMTEXT_UTF8_FGDEFAULT);
    54   if (a)  g_string_append(f->buff, OWL_FMTEXT_UTF8_ATTR_NONE);
     52  if (bg) g_string_append_unichar(f->buff, OWL_FMTEXT_UC_BGDEFAULT);
     53  if (fg) g_string_append_unichar(f->buff, OWL_FMTEXT_UC_FGDEFAULT);
     54  if (a)  g_string_append_unichar(f->buff, OWL_FMTEXT_UC_ATTR | OWL_FMTEXT_UC_ATTR);
    5555}
    5656
     
    180180
    181181  /* Reset attributes */
    182   g_string_append(f->buff, OWL_FMTEXT_UTF8_BGDEFAULT);
    183   g_string_append(f->buff, OWL_FMTEXT_UTF8_FGDEFAULT);
    184   g_string_append(f->buff, OWL_FMTEXT_UTF8_ATTR_NONE);
     182  g_string_append_unichar(f->buff, OWL_FMTEXT_UC_BGDEFAULT);
     183  g_string_append_unichar(f->buff, OWL_FMTEXT_UC_FGDEFAULT);
     184  g_string_append_unichar(f->buff, OWL_FMTEXT_UC_ATTR | OWL_FMTEXT_UC_ATTR);
    185185}
    186186
  • owl.h

    r099597c r7659079  
    101101#define OWL_FMTEXT_UC_ALLCOLOR_MASK ( OWL_FMTEXT_UC_COLOR_MASK | OWL_FMTEXT_UC_DEFAULT_COLOR | 0x200)
    102102#define OWL_FMTEXT_UC_STARTBYTE_UTF8 '\xf4'
    103 
    104 #define OWL_FMTEXT_UTF8_ATTR_NONE "\xf4\x80\xa0\x80"
    105 #define OWL_FMTEXT_UTF8_FGDEFAULT "\xf4\x80\x94\x80"
    106 #define OWL_FMTEXT_UTF8_BGDEFAULT "\xf4\x80\x9C\x80"
    107103
    108104#define OWL_COLOR_BLACK     0
Note: See TracChangeset for help on using the changeset viewer.