Changeset 4b2eef6


Ignore:
Timestamp:
Mar 15, 2016, 3:21:54 PM (8 years ago)
Author:
Karl Ramm <kcr@1ts.org>
Children:
0147aef
Parents:
fc1429d
git-author:
Karl Ramm <kcr@1ts.org> (03/13/16 12:52:17)
git-committer:
Karl Ramm <kcr@1ts.org> (03/15/16 15:21:54)
Message:
implement @roman style from zwgc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r9e219d3 r4b2eef6  
    557557  const struct {
    558558    const char *tag;
    559     const char mask;
     559    enum {SET,  MASK} mode;
     560    const char val;
    560561  } TAGS[] = {
    561     {"", 0},
    562     {"@", 0},
    563     {"@bold", OWL_FMTEXT_ATTR_BOLD},
    564     {"@b", OWL_FMTEXT_ATTR_BOLD},
    565     {"@italic", OWL_FMTEXT_ATTR_UNDERLINE},
    566     {"@i", OWL_FMTEXT_ATTR_UNDERLINE},
     562    {"", MASK, 0},
     563    {"@", MASK, 0},
     564    {"@bold", MASK, OWL_FMTEXT_ATTR_BOLD},
     565    {"@b", MASK, OWL_FMTEXT_ATTR_BOLD},
     566    {"@italic", MASK, OWL_FMTEXT_ATTR_UNDERLINE},
     567    {"@i", MASK, OWL_FMTEXT_ATTR_UNDERLINE},
     568    {"@roman", SET, OWL_FMTEXT_ATTR_NONE},
    567569    {NULL, 0},
    568570  };
     
    575577  for (i = 0; TAGS[i].tag != NULL; i++) {
    576578    if (!strcasecmp(tree->label, TAGS[i].tag)) {
    577       attr |= TAGS[i].mask;
     579      if (TAGS[i].mode == MASK) {
     580        attr |= TAGS[i].val;
     581      } else if (TAGS[i].mode == SET) {
     582        attr = TAGS[i].val;
     583      }
    578584      handled = true;
    579585      break;
Note: See TracChangeset for help on using the changeset viewer.