RTFTranslator: Add support for struck-out text
Change-Id: I900d305328513921068ad63a0e3345578bc61c04 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8862 Tested-by: Commit checker robot <[email protected]> Reviewed-by: John Scipione <[email protected]>
This commit is contained in:
committed by
Axel Dörfler
parent
c1b2086dfd
commit
b697f0ccc8
@@ -459,13 +459,17 @@ TextOutput::Command(RTF::Command *command)
|
|||||||
PrepareTextRun(fCurrentRun);
|
PrepareTextRun(fCurrentRun);
|
||||||
set_font_face(fCurrentRun->font, B_BOLD_FACE, command->Option() != 0);
|
set_font_face(fCurrentRun->font, B_BOLD_FACE, command->Option() != 0);
|
||||||
} else if (!strcmp(name, "i")) {
|
} else if (!strcmp(name, "i")) {
|
||||||
// bold style
|
// italic style
|
||||||
PrepareTextRun(fCurrentRun);
|
PrepareTextRun(fCurrentRun);
|
||||||
set_font_face(fCurrentRun->font, B_ITALIC_FACE, command->Option() != 0);
|
set_font_face(fCurrentRun->font, B_ITALIC_FACE, command->Option() != 0);
|
||||||
} else if (!strcmp(name, "ul")) {
|
} else if (!strcmp(name, "ul")) {
|
||||||
// bold style
|
// underscore style
|
||||||
PrepareTextRun(fCurrentRun);
|
PrepareTextRun(fCurrentRun);
|
||||||
set_font_face(fCurrentRun->font, B_UNDERSCORE_FACE, command->Option() != 0);
|
set_font_face(fCurrentRun->font, B_UNDERSCORE_FACE, command->Option() != 0);
|
||||||
|
} else if (!strcmp(name, "strike")) {
|
||||||
|
// strikeout style
|
||||||
|
PrepareTextRun(fCurrentRun);
|
||||||
|
set_font_face(fCurrentRun->font, B_STRIKEOUT_FACE, command->Option() != 0);
|
||||||
} else if (!strcmp(name, "fs")) {
|
} else if (!strcmp(name, "fs")) {
|
||||||
// font size in half points
|
// font size in half points
|
||||||
PrepareTextRun(fCurrentRun);
|
PrepareTextRun(fCurrentRun);
|
||||||
@@ -779,6 +783,8 @@ status_t convert_styled_text_to_rtf(
|
|||||||
rtfFile << "\\ul";
|
rtfFile << "\\ul";
|
||||||
if (fontFace & B_BOLD_FACE)
|
if (fontFace & B_BOLD_FACE)
|
||||||
rtfFile << "\\b";
|
rtfFile << "\\b";
|
||||||
|
if (fontFace & B_STRIKEOUT_FACE)
|
||||||
|
rtfFile << "\\strike";
|
||||||
|
|
||||||
// RTF font size unit is half-points, but BFont::Size() returns
|
// RTF font size unit is half-points, but BFont::Size() returns
|
||||||
// points
|
// points
|
||||||
|
|||||||
Reference in New Issue
Block a user