1 package be
.nikiroo
.fanfix
.output
;
3 import java
.io
.IOException
;
5 import be
.nikiroo
.fanfix
.Instance
;
6 import be
.nikiroo
.fanfix
.bundles
.StringId
;
7 import be
.nikiroo
.fanfix
.data
.Chapter
;
8 import be
.nikiroo
.fanfix
.data
.Paragraph
.ParagraphType
;
10 class InfoText
extends Text
{
12 private char openQuote
= Instance
.getTrans().getCharacter(
13 StringId
.OPEN_SINGLE_QUOTE
);
14 private char closeQuote
= Instance
.getTrans().getCharacter(
15 StringId
.CLOSE_SINGLE_QUOTE
);
16 private char openDoubleQuote
= Instance
.getTrans().getCharacter(
17 StringId
.OPEN_DOUBLE_QUOTE
);
18 private char closeDoubleQuote
= Instance
.getTrans().getCharacter(
19 StringId
.CLOSE_DOUBLE_QUOTE
);
22 public String
getDefaultExtension(boolean readerTarget
) {
27 protected void writeChapterHeader(Chapter chap
) throws IOException
{
30 if (chap
.getName() != null && !chap
.getName().isEmpty()) {
31 writer
.write(Instance
.getTrans().getString(StringId
.CHAPTER_NAMED
,
32 chap
.getNumber(), chap
.getName()));
34 writer
.write(Instance
.getTrans().getString(
35 StringId
.CHAPTER_UNNAMED
, chap
.getNumber()));
42 protected void writeTextLine(ParagraphType type
, String line
)
47 StringBuilder builder
= new StringBuilder();
48 for (char car
: line
.toCharArray()) {
50 builder
.append("---");
51 } else if (car
== '–') {
53 } else if (car
== openDoubleQuote
) {
55 } else if (car
== closeDoubleQuote
) {
57 } else if (car
== openQuote
) {
59 } else if (car
== closeQuote
) {
66 line
= builder
.toString();
72 super.writeTextLine(type
, line
);