MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / TextPage

Method TextPage

src/org/albite/book/view/TextPage.java:33–567  ·  view source on GitHub ↗
(final Booklet booklet, final PageState ip)

Source from the content-addressed store, hash-verified

31 private ImageRegion imageRegion = null;
32
33 public TextPage(final Booklet booklet, final PageState ip) {
34 this.booklet = booklet;
35
36 final int width = booklet.width;
37 final int height = booklet.height;
38
39 // App Settings
40 final AlbiteFont fontPlain = booklet.fontPlain;
41 final AlbiteFont fontItalic = booklet.fontItalic;
42 final int spaceWidth = fontPlain.charWidth(' ');
43
44 //#debug
45 AlbiteMIDlet.LOGGER.log("Spacewidth: " + spaceWidth);
46
47 int dashWidth = 0;
48 final int fontHeight = booklet.fontHeight;
49 final int fontHeightX2 = 2 * fontHeight;
50 final int fontIndent = booklet.fontIndent;
51 //#if !(TinyMode || TinyModeExport || LightMode || LightModeExport)
52 final ZLTextTeXHyphenator hyphenator = booklet.hyphenator;
53 //#endif
54
55 // Chapter settings
56 final String chapterPath = booklet.getChapter().getPath();
57 final char[] buffer = booklet.getTextBuffer();
58 final int bufferSize;
59 final Archive bookFile = booklet.bookArchive;
60 final Vector images = ip.images;
61
62 byte style;
63 boolean center;
64 byte color;
65
66 AlbiteFont font;
67
68 HyphenatedTextRegion lastHyphenatedWord;
69 boolean startsNewParagraph;
70
71 TextParser parser = ip.parser;
72 int wordPixelWidth; //word width in pixels
73
74 Vector wordsOnThisLine = new Vector(20); //RegionTexts
75
76 boolean firstWord;
77
78 int posX = 0;
79 int posY = 0;
80
81 Vector regionsTemp;
82
83 if (images.isEmpty()) {
84 //text mode
85 regionsTemp = new Vector(300);
86
87 parser.position = end = start = ip.position;
88 parser.length = ip.length;
89
90 bufferSize = buffer.length;

Callers

nothing calls this directly

Calls 15

charWidthMethod · 0.95
chooseFontMethod · 0.95
chooseTextColorMethod · 0.95
parseNextMethod · 0.95
positionWordsOnLineMethod · 0.95
getEntryMethod · 0.95
relativeToAbsoluteURLMethod · 0.95
getLineHeightMethod · 0.95
charsWidthMethod · 0.95
getInfoMethod · 0.95
isHyphenationPossibleMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected