mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 19:42:17 +02:00
Now using descent correctly while displaying lines
Started implementing decorations git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@180 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
parent
04e04231d3
commit
24d594e9bc
6 changed files with 92 additions and 4 deletions
|
@ -36,10 +36,18 @@ public class ZLTextViewImpl extends ZLTextView {
|
|||
myContext.setFont(myStyle.fontFamily(), myStyle.fontSize(), myStyle.bold(), myStyle.italic());
|
||||
}
|
||||
|
||||
/* public void applyControl(ZLTextControlElement control) {
|
||||
}
|
||||
public void applyControl(ZLTextControlElement control) {
|
||||
/* if (control.isStart()) {
|
||||
ZLTextStyleDecoration decoration = new ZLTextStyleDecoration(control.getEntry());
|
||||
setStyle(decoration.createDecoratedStyle(myStyle));
|
||||
} else {
|
||||
if (myStyle.isDecorated()) {
|
||||
setStyle(((ZLTextDecoratedStyle) myStyle).base());
|
||||
}
|
||||
}
|
||||
*/ }
|
||||
|
||||
|
||||
*/
|
||||
public ZLPaintContext getPaintContext() {
|
||||
return myContext;
|
||||
}
|
||||
|
@ -146,7 +154,7 @@ public class ZLTextViewImpl extends ZLTextView {
|
|||
w += dw;
|
||||
}
|
||||
}
|
||||
h += info.Height;
|
||||
h += info.Height + info.Descent;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
BIN
src/org/zlibrary/text/view/style/ZLTextBaseStyle.class
Normal file
BIN
src/org/zlibrary/text/view/style/ZLTextBaseStyle.class
Normal file
Binary file not shown.
|
@ -0,0 +1,4 @@
|
|||
package org.zlibrary.text.view.style;
|
||||
|
||||
public class ZLTextDecoratedStyle {
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.zlibrary.text.view.style;
|
||||
|
||||
public class ZLTextFullDecoratedStyle {
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package org.zlibrary.text.view.style;
|
||||
|
||||
import org.zlibrary.options.*;
|
||||
import org.zlibrary.options.util.*;
|
||||
|
||||
import org.zlibrary.text.view.ZLTextStyle;
|
||||
|
||||
import org.zlibrary.text.model.ZLTextAlignmentType;
|
||||
|
||||
public class ZLTextFullStyleDecoration extends ZLTextStyleDecoration {
|
||||
public ZLIntegerRangeOption SpaceBeforeOption;
|
||||
public ZLIntegerRangeOption SpaceAfterOption;
|
||||
public ZLIntegerRangeOption LeftIndentOption;
|
||||
public ZLIntegerRangeOption RightIndentOption;
|
||||
public ZLIntegerRangeOption FirstLineIndentDeltaOption;
|
||||
|
||||
public ZLIntegerOption AlignmentOption;
|
||||
|
||||
public ZLDoubleOption LineSpaceOption;
|
||||
|
||||
public ZLTextFullStyleDecoration(String name, int fontSizeDelta, ZLBoolean3 bold, ZLBoolean3 italic, int spaceBefore, int spaceAfter, int leftIndent,int rightIndent, int firstLineDelta, int verticalShift, ZLTextAlignmentType alignment, double lineSpace, ZLBoolean3 allowHyphenations) {
|
||||
super(name, fontSizeDelta, bold, italic, verticalShift, allowHyphenations);
|
||||
}
|
||||
|
||||
public boolean isFullDecoration() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// public ZLTextStyle createDecoratedStyle(ZLTextStyle base) {
|
||||
//
|
||||
// }
|
||||
}
|
39
src/org/zlibrary/text/view/style/ZLTextStyleDecoration.java
Normal file
39
src/org/zlibrary/text/view/style/ZLTextStyleDecoration.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package org.zlibrary.text.view.style;
|
||||
|
||||
import org.zlibrary.options.util.*;
|
||||
import org.zlibrary.options.*;
|
||||
|
||||
import org.zlibrary.text.view.ZLTextStyle;
|
||||
|
||||
|
||||
public class ZLTextStyleDecoration {
|
||||
public static final String STYLE = "Style";
|
||||
|
||||
public ZLStringOption FontFamilyOption;
|
||||
public ZLIntegerRangeOption FontSizeDeltaOption;
|
||||
public ZLBoolean3Option BoldOption;
|
||||
public ZLBoolean3Option ItalicOption;
|
||||
|
||||
private String myName;
|
||||
|
||||
public ZLIntegerOption VerticalShiftOption;
|
||||
|
||||
public ZLBoolean3Option AllowHyphenationsOption;
|
||||
|
||||
public ZLTextStyleDecoration(String name, int fontSizeDelta, ZLBoolean3 bold, ZLBoolean3 italic, int verticalShift, ZLBoolean3 allowHyphenations) {
|
||||
FontFamilyOption = null;
|
||||
FontSizeDeltaOption = null;
|
||||
BoldOption = new ZLBoolean3Option(ZLOption.LOOK_AND_FEEL_CATEGORY, STYLE, name + ":bold", bold);
|
||||
ItalicOption = null;
|
||||
VerticalShiftOption = null;
|
||||
AllowHyphenationsOption = null;
|
||||
}
|
||||
|
||||
public boolean isFullDecoration() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return myName;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue