diff options
| author | Simon Tatham <anakin@pobox.com> | 2013-03-10 16:58:01 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2013-03-10 16:58:01 +0000 |
| commit | dcf080aa0e011de37a154e9e8a97dd7546a4a1b1 (patch) | |
| tree | 891d703334a6d4f4899f058234c52d56cb7bdb3b /bk_whlp.c | |
| parent | 1489dc15967970576d08f3f2b22c6e1c939bcbcf (diff) | |
| download | halibut-dcf080aa0e011de37a154e9e8a97dd7546a4a1b1.zip halibut-dcf080aa0e011de37a154e9e8a97dd7546a4a1b1.tar.gz halibut-dcf080aa0e011de37a154e9e8a97dd7546a4a1b1.tar.bz2 halibut-dcf080aa0e011de37a154e9e8a97dd7546a4a1b1.tar.xz | |
Add \s for 'strong' text, i.e. bold rather than italics. I've missed
this a couple of times in Halibut markup recently (in particular, it's
handy to have a typographical distinction between 'this term is
emphasised because it's new' and 'this term is emphasised because I
want you to pay attention to it'), so here's an implementation,
basically parallel to \e.
One slight oddity is that strong text in headings will not be
distinguished in some output formats, since they already use bolded
text for their headings.
[originally from svn r9772]
Diffstat (limited to 'bk_whlp.c')
| -rw-r--r-- | bk_whlp.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -34,11 +34,13 @@ typedef struct { enum { FONT_NORMAL, FONT_EMPH, + FONT_STRONG, FONT_CODE, FONT_ITAL_CODE, FONT_BOLD_CODE, FONT_TITLE, FONT_TITLE_EMPH, + FONT_TITLE_STRONG, FONT_TITLE_CODE, FONT_RULE }; @@ -174,6 +176,8 @@ void whlp_backend(paragraph *sourceform, keywordlist *keywords, 0, 0, 0, 0); whlp_create_font(h, "Times New Roman", WHLP_FONTFAM_SERIF, 24, WHLP_FONT_ITALIC, 0, 0, 0); + whlp_create_font(h, "Times New Roman", WHLP_FONTFAM_SERIF, 24, + WHLP_FONT_BOLD, 0, 0, 0); whlp_create_font(h, "Courier New", WHLP_FONTFAM_FIXED, 24, 0, 0, 0, 0); whlp_create_font(h, "Courier New", WHLP_FONTFAM_FIXED, 24, @@ -184,6 +188,8 @@ void whlp_backend(paragraph *sourceform, keywordlist *keywords, WHLP_FONT_BOLD, 0, 0, 0); whlp_create_font(h, "Arial", WHLP_FONTFAM_SERIF, 30, WHLP_FONT_BOLD|WHLP_FONT_ITALIC, 0, 0, 0); + whlp_create_font(h, "Arial", WHLP_FONTFAM_SERIF, 30, + WHLP_FONT_BOLD, 0, 0, 0); whlp_create_font(h, "Courier New", WHLP_FONTFAM_FIXED, 30, WHLP_FONT_BOLD, 0, 0, 0); whlp_create_font(h, "Courier New", WHLP_FONTFAM_SANS, 18, @@ -753,18 +759,23 @@ static void whlp_mkparagraph(struct bk_whlp_state *state, case word_Normal: case word_Emph: + case word_Strong: case word_Code: case word_WeakCode: case word_WhiteSpace: case word_EmphSpace: + case word_StrongSpace: case word_CodeSpace: case word_WkCodeSpace: case word_Quote: case word_EmphQuote: + case word_StrongQuote: case word_CodeQuote: case word_WkCodeQuote: if (towordstyle(text->type) == word_Emph) newfont = deffont + FONT_EMPH; + else if (towordstyle(text->type) == word_Strong) + newfont = deffont + FONT_STRONG; else if (towordstyle(text->type) == word_Code || towordstyle(text->type) == word_WeakCode) newfont = deffont + FONT_CODE; @@ -808,14 +819,17 @@ static void whlp_rdaddwc(rdstringc *rs, word *text, whlpconf *conf, case word_Normal: case word_Emph: + case word_Strong: case word_Code: case word_WeakCode: case word_WhiteSpace: case word_EmphSpace: + case word_StrongSpace: case word_CodeSpace: case word_WkCodeSpace: case word_Quote: case word_EmphQuote: + case word_StrongQuote: case word_CodeQuote: case word_WkCodeQuote: assert(text->type != word_CodeQuote && |