mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +02:00
new options: "apply/ignore CSS defined values"
This commit is contained in:
parent
ed74b9acf9
commit
f117b0a3fb
39 changed files with 309 additions and 49 deletions
|
@ -1,6 +1,7 @@
|
|||
===== 1.6.3 (Oct ??, 2012) =====
|
||||
* FBReader stores text position after setPageStart API method (useful for TTS plugin, code by Greg Kochaniak)
|
||||
* MSWord doc plugin synchronized with the main branch
|
||||
* New options: apply/ignore values defined in CSS
|
||||
|
||||
===== 1.6.2 (Oct 13, 2012) =====
|
||||
* Optimized animation speed
|
||||
|
|
|
@ -507,6 +507,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Barvy a pozadí">
|
||||
<node name="summary" value="Nastavení barev"/>
|
||||
<node name="background" value="Pozadí">
|
||||
|
|
|
@ -501,6 +501,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Farben & Hintergründe">
|
||||
<node name="summary" value="Farben festlegen."/>
|
||||
<node name="background" value="Hintergrund">
|
||||
|
|
|
@ -507,6 +507,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS"/>
|
||||
<node name="fontSize" value="Font size">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Colors & wallpapers">
|
||||
<node name="summary" value="Color settings"/>
|
||||
<node name="background" value="Background">
|
||||
|
|
|
@ -500,6 +500,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Colores y fondos de pantalla">
|
||||
<node name="summary" value="Preferencias de color"/>
|
||||
<node name="background" value="Fondo">
|
||||
|
|
|
@ -500,6 +500,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Couleurs & fonds d'écran">
|
||||
<node name="summary" value="Paramètres des couleurs"/>
|
||||
<node name="background" value="Arrière-plan">
|
||||
|
|
|
@ -497,6 +497,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Cores e fondos de pantalla">
|
||||
<node name="summary" value="Preferencias de cor"/>
|
||||
<node name="background" value="Fondo">
|
||||
|
|
|
@ -497,6 +497,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Színek és háttérképek">
|
||||
<node name="summary" value="Színbeállítások"/>
|
||||
<node name="background" value="Háttér">
|
||||
|
|
|
@ -498,6 +498,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Colori & sfondi">
|
||||
<node name="summary" value="Impostazioni dei colori"/>
|
||||
<node name="background" value="Sfondo">
|
||||
|
|
|
@ -507,6 +507,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Farger og bakgrunnsbilder">
|
||||
<node name="summary" value="Fargeinnstillinger"/>
|
||||
<node name="background" value="Bakgrunn">
|
||||
|
|
|
@ -497,6 +497,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Kleuren">
|
||||
<node name="summary" value="Kleurinstellingen"/>
|
||||
<node name="background" value="Achtergrond">
|
||||
|
|
|
@ -497,6 +497,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Kolory i tapety">
|
||||
<node name="summary" value="Ustawienia kolorów"/>
|
||||
<node name="background" value="Tło">
|
||||
|
|
|
@ -509,6 +509,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Cores & papéis de parede">
|
||||
<node name="summary" value="Configurações de cor"/>
|
||||
<node name="background" value="Fundo">
|
||||
|
|
|
@ -497,6 +497,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Culori si imagini de fundal">
|
||||
<node name="summary" value="Setarile de culoare"/>
|
||||
<node name="background" value="Fundal">
|
||||
|
|
|
@ -512,6 +512,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Цвета и обои">
|
||||
<node name="summary" value="Настройки цвета"/>
|
||||
<node name="background" value="Фон">
|
||||
|
|
|
@ -507,6 +507,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Боје и позадине">
|
||||
<node name="summary" value="Подешавања боја."/>
|
||||
<node name="background" value="Позадина">
|
||||
|
|
|
@ -497,6 +497,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="สี & วอลล์เปเปอร์">
|
||||
<node name="summary" value="การตั้งค่าสี"/>
|
||||
<node name="background" value="พื้นหลัง">
|
||||
|
|
|
@ -507,6 +507,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Renkler & duvarkağıtları">
|
||||
<node name="summary" value="Renk ayarları"/>
|
||||
<node name="background" value="Arkaplan">
|
||||
|
|
|
@ -497,6 +497,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Кольори & шпалери">
|
||||
<node name="summary" value="Налаштування кольору"/>
|
||||
<node name="background" value="Фон">
|
||||
|
|
|
@ -497,6 +497,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="Colors & wallpapers" toBeTranslated="true">
|
||||
<node name="summary" value="Color settings"/>
|
||||
<node name="background" value="Nền">
|
||||
|
|
|
@ -497,6 +497,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="颜色 & 墙纸">
|
||||
<node name="summary" value="设置颜色"/>
|
||||
<node name="background" value="背景色">
|
||||
|
|
|
@ -502,6 +502,17 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node name="css" value="CSS" toBeTranslated="true">
|
||||
<node name="summary" value="Apply/ignore values defined in CSS" toBeTranslated="true"/>
|
||||
<node name="fontSize" value="Font size" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply font size defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore font size defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
<node name="textAlignment" value="Text alignment" toBeTranslated="true">
|
||||
<node name="summaryOn" value="Apply text alignment defined in CSS" toBeTranslated="true"/>
|
||||
<node name="summaryOff" value="Ignore text alignment defined in CSS" toBeTranslated="true"/>
|
||||
</node>
|
||||
</node>
|
||||
<node name="colors" value="顏色及壁紙">
|
||||
<node name="summary" value="顏色設定"/>
|
||||
<node name="background" value="背景">
|
||||
|
|
|
@ -148,7 +148,7 @@ const std::vector<std::string> &StyleSheetTable::values(const AttributeMap &map,
|
|||
}
|
||||
|
||||
shared_ptr<ZLTextStyleEntry> StyleSheetTable::createControl(const AttributeMap &styles) {
|
||||
shared_ptr<ZLTextStyleEntry> entry = new ZLTextStyleEntry();
|
||||
shared_ptr<ZLTextStyleEntry> entry = new ZLTextStyleEntry(ZLTextStyleEntry::STYLE_CSS_ENTRY);
|
||||
|
||||
const std::vector<std::string> &alignment = values(styles, "text-align");
|
||||
if (!alignment.empty()) {
|
||||
|
|
|
@ -274,7 +274,7 @@ void DocBookReader::handleParagraphStyle(const OleMainStream::Style &styleInfo)
|
|||
if (styleInfo.HasPageBreakBefore) {
|
||||
handlePageBreak();
|
||||
}
|
||||
shared_ptr<ZLTextStyleEntry> entry = new ZLTextStyleEntry();
|
||||
shared_ptr<ZLTextStyleEntry> entry = new ZLTextStyleEntry(ZLTextStyleEntry::STYLE_OTHER_ENTRY);
|
||||
|
||||
switch (styleInfo.Alignment) {
|
||||
default: // in that case, use default alignment type
|
||||
|
|
|
@ -224,7 +224,7 @@ void RtfBookReader::setEncoding(int) {
|
|||
}
|
||||
|
||||
void RtfBookReader::setAlignment() {
|
||||
ZLTextStyleEntry entry;
|
||||
ZLTextStyleEntry entry(ZLTextStyleEntry::STYLE_OTHER_ENTRY);
|
||||
entry.setAlignmentType(myState.Alignment);
|
||||
myBookReader.addStyleEntry(entry);
|
||||
// TODO: call addStyleCloseEntry somewhere (?)
|
||||
|
|
|
@ -598,7 +598,7 @@ void XHTMLReader::beginParagraph() {
|
|||
}
|
||||
|
||||
if (doBlockSpaceBefore) {
|
||||
ZLTextStyleEntry blockingEntry;
|
||||
ZLTextStyleEntry blockingEntry(ZLTextStyleEntry::STYLE_CSS_ENTRY);
|
||||
blockingEntry.setLength(
|
||||
ZLTextStyleEntry::LENGTH_SPACE_BEFORE,
|
||||
0,
|
||||
|
@ -616,7 +616,7 @@ void XHTMLReader::endParagraph() {
|
|||
(*it)->isFeatureSupported(ZLTextStyleEntry::LENGTH_SPACE_AFTER);
|
||||
}
|
||||
if (doBlockSpaceAfter) {
|
||||
ZLTextStyleEntry blockingEntry;
|
||||
ZLTextStyleEntry blockingEntry(ZLTextStyleEntry::STYLE_CSS_ENTRY);
|
||||
blockingEntry.setLength(
|
||||
ZLTextStyleEntry::LENGTH_SPACE_AFTER,
|
||||
0,
|
||||
|
|
|
@ -270,7 +270,7 @@ void ZLTextModel::addStyleEntry(const ZLTextStyleEntry &entry) {
|
|||
myLastEntryStart = myAllocator->allocate(len);
|
||||
char *address = myLastEntryStart;
|
||||
|
||||
*address++ = ZLTextParagraphEntry::STYLE_ENTRY;
|
||||
*address++ = entry.entryKind();
|
||||
*address++ = 0;
|
||||
address = ZLCachedMemoryAllocator::writeUInt16(address, entry.myFeatureMask);
|
||||
|
||||
|
|
|
@ -41,10 +41,11 @@ public:
|
|||
IMAGE_ENTRY = 2,
|
||||
CONTROL_ENTRY = 3,
|
||||
HYPERLINK_CONTROL_ENTRY = 4,
|
||||
STYLE_ENTRY = 5,
|
||||
STYLE_CLOSE_ENTRY = 6,
|
||||
FIXED_HSPACE_ENTRY = 7,
|
||||
RESET_BIDI_ENTRY = 8,
|
||||
STYLE_CSS_ENTRY = 5,
|
||||
STYLE_OTHER_ENTRY = 6,
|
||||
STYLE_CLOSE_ENTRY = 7,
|
||||
FIXED_HSPACE_ENTRY = 8,
|
||||
RESET_BIDI_ENTRY = 9,
|
||||
};
|
||||
|
||||
protected:
|
||||
|
|
|
@ -77,10 +77,12 @@ private:
|
|||
};
|
||||
|
||||
public:
|
||||
ZLTextStyleEntry();
|
||||
ZLTextStyleEntry(unsigned char entryKind);
|
||||
//ZLTextStyleEntry(char *address);
|
||||
~ZLTextStyleEntry();
|
||||
|
||||
unsigned char entryKind() const;
|
||||
|
||||
bool isEmpty() const;
|
||||
bool isFeatureSupported(Feature featureId) const;
|
||||
|
||||
|
@ -97,6 +99,7 @@ public:
|
|||
void setFontFamily(const std::string &fontFamily);
|
||||
|
||||
private:
|
||||
unsigned char myEntryKind;
|
||||
unsigned short myFeatureMask;
|
||||
|
||||
LengthType myLengths[NUMBER_OF_LENGTHS];
|
||||
|
@ -108,9 +111,11 @@ private:
|
|||
friend class ZLTextModel;
|
||||
};
|
||||
|
||||
inline ZLTextStyleEntry::ZLTextStyleEntry() : myFeatureMask(0), myAlignmentType(ALIGN_UNDEFINED), mySupportedFontModifier(0), myFontModifier(0) {}
|
||||
inline ZLTextStyleEntry::ZLTextStyleEntry(unsigned char entryKind) : myEntryKind(entryKind), myFeatureMask(0), myAlignmentType(ALIGN_UNDEFINED), mySupportedFontModifier(0), myFontModifier(0) {}
|
||||
inline ZLTextStyleEntry::~ZLTextStyleEntry() {}
|
||||
|
||||
inline unsigned char ZLTextStyleEntry::entryKind() const { return myEntryKind; }
|
||||
|
||||
inline ZLTextStyleEntry::Metrics::Metrics(int fontSize, int fontXHeight, int fullWidth, int fullHeight) : FontSize(fontSize), FontXHeight(fontXHeight), FullWidth(fullWidth), FullHeight(fullHeight) {}
|
||||
|
||||
inline bool ZLTextStyleEntry::isEmpty() const { return myFeatureMask == 0; }
|
||||
|
|
|
@ -253,6 +253,10 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
|||
final ZLPreferenceSet footerPreferences = new ZLPreferenceSet();
|
||||
final ZLPreferenceSet bgPreferences = new ZLPreferenceSet();
|
||||
|
||||
final Screen cssScreen = createPreferenceScreen("css");
|
||||
cssScreen.addOption(collection.UseCSSFontSizeOption, "fontSize");
|
||||
cssScreen.addOption(collection.UseCSSTextAlignmentOption, "textAlignment");
|
||||
|
||||
final Screen colorsScreen = createPreferenceScreen("colors");
|
||||
colorsScreen.addPreference(new WallpaperPreference(
|
||||
this, profile, colorsScreen.Resource, "background"
|
||||
|
|
|
@ -32,7 +32,7 @@ class ChangeFontSizeAction extends FBAction {
|
|||
|
||||
@Override
|
||||
protected void run(Object ... params) {
|
||||
ZLIntegerRangeOption option =
|
||||
final ZLIntegerRangeOption option =
|
||||
ZLTextStyleCollection.Instance().getBaseStyle().FontSizeOption;
|
||||
option.setValue(option.getValue() + myDelta);
|
||||
Reader.clearTextCaches();
|
||||
|
|
|
@ -25,10 +25,11 @@ public interface ZLTextParagraph {
|
|||
byte IMAGE = 2;
|
||||
byte CONTROL = 3;
|
||||
byte HYPERLINK_CONTROL = 4;
|
||||
byte STYLE = 5;
|
||||
byte STYLE_CLOSE = 6;
|
||||
byte FIXED_HSPACE = 7;
|
||||
byte RESET_BIDI = 8;
|
||||
byte STYLE_CSS = 5;
|
||||
byte STYLE_OTHER = 6;
|
||||
byte STYLE_CLOSE = 7;
|
||||
byte FIXED_HSPACE = 8;
|
||||
byte RESET_BIDI = 9;
|
||||
}
|
||||
|
||||
interface EntryIterator {
|
||||
|
|
|
@ -188,9 +188,13 @@ public class ZLTextPlainModel implements ZLTextModel, ZLTextStyleEntry.Feature {
|
|||
case ZLTextParagraph.Entry.FIXED_HSPACE:
|
||||
myFixedHSpaceLength = (short)data[dataOffset++];
|
||||
break;
|
||||
case ZLTextParagraph.Entry.STYLE:
|
||||
case ZLTextParagraph.Entry.STYLE_CSS:
|
||||
case ZLTextParagraph.Entry.STYLE_OTHER:
|
||||
{
|
||||
final ZLTextStyleEntry entry = new ZLTextStyleEntry();
|
||||
final ZLTextStyleEntry entry =
|
||||
type == ZLTextParagraph.Entry.STYLE_CSS
|
||||
? new ZLTextCSSStyleEntry()
|
||||
: new ZLTextOtherStyleEntry();
|
||||
|
||||
final short mask = (short)data[dataOffset++];
|
||||
for (int i = 0; i < NUMBER_OF_LENGTHS; ++i) {
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.geometerplus.zlibrary.text.model;
|
|||
|
||||
import org.geometerplus.zlibrary.core.util.ZLBoolean3;
|
||||
|
||||
public final class ZLTextStyleEntry {
|
||||
public abstract class ZLTextStyleEntry {
|
||||
public interface Feature {
|
||||
int LENGTH_LEFT_INDENT = 0;
|
||||
int LENGTH_RIGHT_INDENT = 1;
|
||||
|
@ -76,14 +76,14 @@ public final class ZLTextStyleEntry {
|
|||
return (mask & (1 << featureId)) != 0;
|
||||
}
|
||||
|
||||
public boolean isFeatureSupported(int featureId) {
|
||||
protected ZLTextStyleEntry() {
|
||||
}
|
||||
|
||||
public final boolean isFeatureSupported(int featureId) {
|
||||
return isFeatureSupported(myFeatureMask, featureId);
|
||||
}
|
||||
|
||||
public ZLTextStyleEntry() {
|
||||
}
|
||||
|
||||
void setLength(int featureId, short size, byte unit) {
|
||||
final void setLength(int featureId, short size, byte unit) {
|
||||
myFeatureMask |= 1 << featureId;
|
||||
myLengths[featureId] = new Length(size, unit);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public final class ZLTextStyleEntry {
|
|||
}
|
||||
}
|
||||
|
||||
public int getLength(int featureId, ZLTextMetrics metrics) {
|
||||
public final int getLength(int featureId, ZLTextMetrics metrics) {
|
||||
switch (myLengths[featureId].Unit) {
|
||||
default:
|
||||
case SizeUnit.PIXEL:
|
||||
|
@ -122,31 +122,31 @@ public final class ZLTextStyleEntry {
|
|||
}
|
||||
}
|
||||
|
||||
void setAlignmentType(byte alignmentType) {
|
||||
final void setAlignmentType(byte alignmentType) {
|
||||
myFeatureMask |= 1 << Feature.ALIGNMENT_TYPE;
|
||||
myAlignmentType = alignmentType;
|
||||
}
|
||||
|
||||
public byte getAlignmentType() {
|
||||
public final byte getAlignmentType() {
|
||||
return myAlignmentType;
|
||||
}
|
||||
|
||||
void setFontFamily(String fontFamily) {
|
||||
final void setFontFamily(String fontFamily) {
|
||||
myFeatureMask |= 1 << Feature.FONT_FAMILY;
|
||||
myFontFamily = fontFamily;
|
||||
}
|
||||
|
||||
public String getFontFamily() {
|
||||
public final String getFontFamily() {
|
||||
return myFontFamily;
|
||||
}
|
||||
|
||||
void setFontModifiers(byte supported, byte values) {
|
||||
final void setFontModifiers(byte supported, byte values) {
|
||||
myFeatureMask |= 1 << Feature.FONT_STYLE_MODIFIER;
|
||||
mySupportedFontModifiers = supported;
|
||||
myFontModifiers = values;
|
||||
}
|
||||
|
||||
void setFontModifier(byte modifier, boolean on) {
|
||||
final void setFontModifier(byte modifier, boolean on) {
|
||||
myFeatureMask |= 1 << Feature.FONT_STYLE_MODIFIER;
|
||||
mySupportedFontModifiers |= modifier;
|
||||
if (on) {
|
||||
|
@ -156,7 +156,7 @@ public final class ZLTextStyleEntry {
|
|||
}
|
||||
}
|
||||
|
||||
public ZLBoolean3 getFontModifier(byte modifier) {
|
||||
public final ZLBoolean3 getFontModifier(byte modifier) {
|
||||
if ((mySupportedFontModifiers & modifier) == 0) {
|
||||
return ZLBoolean3.B3_UNDEFINED;
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ public final class ZLTextWritablePlainModel extends ZLTextPlainModel implements
|
|||
}
|
||||
final char[] block = getDataBlock(len);
|
||||
++myParagraphLengths[myParagraphsNumber - 1];
|
||||
block[myBlockOffset++] = (char)ZLTextParagraph.Entry.STYLE;
|
||||
block[myBlockOffset++] = (char)ZLTextParagraph.Entry.STYLE; // CSS or OTHER
|
||||
block[myBlockOffset++] = (char)entry.getMask();
|
||||
if (entry.isLeftIndentSupported()) {
|
||||
block[myBlockOffset++] = (char)entry.getLeftIndent();
|
||||
|
|
|
@ -100,7 +100,8 @@ public final class ZLTextParagraphCursor {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case ZLTextParagraph.Entry.STYLE:
|
||||
case ZLTextParagraph.Entry.STYLE_CSS:
|
||||
case ZLTextParagraph.Entry.STYLE_OTHER:
|
||||
elements.add(new ZLTextStyleElement(it.getStyleEntry()));
|
||||
break;
|
||||
case ZLTextParagraph.Entry.STYLE_CLOSE:
|
||||
|
|
|
@ -54,7 +54,7 @@ public class ZLTextBaseStyle extends ZLTextStyle {
|
|||
super(null, ZLTextHyperlink.NO_LINK);
|
||||
FontFamilyOption = new ZLStringOption(GROUP, "Base:fontFamily", fontFamily);
|
||||
fontSize = fontSize * ZLibrary.Instance().getDisplayDPI() / 320 * 2;
|
||||
FontSizeOption = new ZLIntegerRangeOption(GROUP, "Base:fontSize", 5, 72, fontSize);
|
||||
FontSizeOption = new ZLIntegerRangeOption(GROUP, "Base:fontSize", 5, Math.max(72, fontSize * 2), fontSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,9 +21,7 @@ package org.geometerplus.zlibrary.text.view.style;
|
|||
|
||||
import org.geometerplus.zlibrary.core.util.ZLBoolean3;
|
||||
|
||||
import org.geometerplus.zlibrary.text.model.ZLTextMetrics;
|
||||
import org.geometerplus.zlibrary.text.model.ZLTextStyleEntry;
|
||||
|
||||
import org.geometerplus.zlibrary.text.model.*;
|
||||
import org.geometerplus.zlibrary.text.view.ZLTextStyle;
|
||||
|
||||
public class ZLTextExplicitlyDecoratedStyle extends ZLTextDecoratedStyle implements ZLTextStyleEntry.Feature, ZLTextStyleEntry.FontModifier {
|
||||
|
@ -43,6 +41,10 @@ public class ZLTextExplicitlyDecoratedStyle extends ZLTextDecoratedStyle impleme
|
|||
}
|
||||
@Override
|
||||
protected int getFontSizeInternal(ZLTextMetrics metrics) {
|
||||
if (myEntry instanceof ZLTextCSSStyleEntry &&
|
||||
!ZLTextStyleCollection.Instance().UseCSSFontSizeOption.getValue()) {
|
||||
return Base.getFontSize(metrics);
|
||||
}
|
||||
if (myEntry.isFeatureSupported(FONT_STYLE_MODIFIER)) {
|
||||
if (myEntry.getFontModifier(FONT_MODIFIER_INHERIT) == ZLBoolean3.B3_TRUE) {
|
||||
return Base.Base.getFontSize(metrics);
|
||||
|
@ -135,6 +137,10 @@ public class ZLTextExplicitlyDecoratedStyle extends ZLTextDecoratedStyle impleme
|
|||
return Base.getSpaceAfter();
|
||||
}
|
||||
public byte getAlignment() {
|
||||
if (myEntry instanceof ZLTextCSSStyleEntry &&
|
||||
!ZLTextStyleCollection.Instance().UseCSSTextAlignmentOption.getValue()) {
|
||||
return Base.getAlignment();
|
||||
}
|
||||
return
|
||||
myEntry.isFeatureSupported(ALIGNMENT_TYPE)
|
||||
? myEntry.getAlignmentType()
|
||||
|
|
|
@ -19,23 +19,16 @@
|
|||
|
||||
package org.geometerplus.zlibrary.text.view.style;
|
||||
|
||||
import org.geometerplus.zlibrary.core.filesystem.ZLResourceFile;
|
||||
import org.geometerplus.zlibrary.core.library.ZLibrary;
|
||||
import org.geometerplus.zlibrary.core.options.ZLBooleanOption;
|
||||
import org.geometerplus.zlibrary.core.util.ZLBoolean3;
|
||||
import org.geometerplus.zlibrary.core.xml.*;
|
||||
import org.geometerplus.zlibrary.text.model.ZLTextAlignmentType;
|
||||
import org.geometerplus.zlibrary.core.filesystem.ZLResourceFile;
|
||||
|
||||
public class ZLTextStyleCollection {
|
||||
private static ZLTextStyleCollection ourInstance = null;
|
||||
|
||||
private int myDefaultFontSize;
|
||||
private ZLTextBaseStyle myBaseStyle;
|
||||
private final ZLTextStyleDecoration[] myDecorationMap = new ZLTextStyleDecoration[256];
|
||||
|
||||
private ZLTextStyleCollection() {
|
||||
new TextStyleReader(this).readQuietly(ZLResourceFile.createResourceFile("default/styles.xml"));
|
||||
}
|
||||
|
||||
public static ZLTextStyleCollection Instance() {
|
||||
if (ourInstance == null) {
|
||||
ourInstance = new ZLTextStyleCollection();
|
||||
|
@ -47,6 +40,19 @@ public class ZLTextStyleCollection {
|
|||
ourInstance = null;
|
||||
}
|
||||
|
||||
private int myDefaultFontSize;
|
||||
private ZLTextBaseStyle myBaseStyle;
|
||||
private final ZLTextStyleDecoration[] myDecorationMap = new ZLTextStyleDecoration[256];
|
||||
|
||||
public final ZLBooleanOption UseCSSTextAlignmentOption =
|
||||
new ZLBooleanOption("Style", "css:textAlignment", true);
|
||||
public final ZLBooleanOption UseCSSFontSizeOption =
|
||||
new ZLBooleanOption("Style", "css:fontSize", true);
|
||||
|
||||
private ZLTextStyleCollection() {
|
||||
new TextStyleReader(this).readQuietly(ZLResourceFile.createResourceFile("default/styles.xml"));
|
||||
}
|
||||
|
||||
public int getDefaultFontSize() {
|
||||
return myDefaultFontSize;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue