Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- generalSettings: {
- //secondPassStylesheet: "./data/stylesheet2.json",
- enableDoubleRenderingOutline: "true",
- //bodiesToRender: "//body",
- bodiesToRender: "//body[empty(@name) or (@name != 'notes' and @name != 'comments')]",
- generateTOC: "true",
- generateFrontMatter: "true",
- generateNoteBackLinks: "true",
- generateInternalLinks: "true",
- transliterateMetaInfo: "true",
- forceTransliterateAuthor: "true",//"false",
- metaAuthorQuery: "(last-name, first-name, middle-name)",
- imageDpi: 168.212, // PRS-500/505/600/700/650/900/950, Kindle
- //imageDpi: 200, // PRS-300/350
- //imageDpi: 150, // Kindle DX
- stretchCover: "true",
- enableInlineImages: "true",//"false",
- fullCompression: "false",
- trackingSpaceCharRatio: 10000000, //Inter-character spacing disabled with 10000000 | in OLD was 5.0
- overrideImageTransparency: "",
- makeGrayImageTransparent: "true",//"false",
- cacheImages: "false",
- ignoreEmptyLineBeforeImage: "true",
- ignoreEmptyLineAfterImage: "true",
- strictImageSequence: "false",
- enableLinkPageNum: "false",
- linkPageNumFormat: "[%04d]",
- linkPageNumMax: 9999,
- hangingPunctuation: ".,;:'-"
- },
- fontFamilies: [
- {
- name: "sansSerif",
- regular: "./data/PT Sans-Regular.ttf",
- bold: "./data/PT Sans-Bold.ttf",
- italic: "./data/PT Sans-Italic.ttf",
- boldItalic: "./data/PT Sans-Bold-Italic.ttf"
- },
- {
- name: "serif",
- regular: "./data/PT Serif-Regular.ttf",
- bold: "./data/PT Serif-Bold.ttf",
- italic: "./data/PT Serif-Italic.ttf",
- boldItalic: "./data/PT Serif-Bold-Italic.ttf"
- },
- {
- name: "monospaced",
- regular: "./data/LiberationMono-Regular.ttf",
- bold: "./data/LiberationMono-Bold.ttf",
- italic: "./data/LiberationMono-Italic.ttf",
- boldItalic: "./data/LiberationMono-BoldItalic.ttf"
- }
- /*
- {
- name: "sansSerif",
- regular: "./data/FreeSans.ttf",
- bold: "./data/FreeSansBold.ttf",
- italic: "./data/FreeSansOblique.ttf",
- boldItalic: "./data/FreeSansBoldOblique.ttf"
- },
- {
- name: "serif",
- regular: "./data/DroidSerif-Regular.ttf",
- bold: "./data/DroidSerif-Bold.ttf",
- italic: "./data/DroidSerif-Italic.ttf",
- boldItalic: "./data/DroidSerif-BoldItalic.ttf"
- },
- {
- name: "monospaced",
- regular: "./data/LiberationMono-Regular.ttf",
- bold: "./data/LiberationMono-Bold.ttf",
- italic: "./data/LiberationMono-Italic.ttf",
- boldItalic: "./data/LiberationMono-BoldItalic.ttf"
- }
- {
- name: "sansSerif",
- regular: "c:/windows/fonts/calibri.ttf",
- bold: "c:/windows/fonts/calibrib.ttf",
- italic: "c:/windows/fonts/calibrii.ttf",
- boldItalic: "c:/windows/fonts/calibriz.ttf"
- },
- {
- name: "serif",
- regular: "c:/windows/fonts/CAMBRIA.TTC,0",
- bold: "c:/windows/fonts/CAMBRIAB.TTF",
- italic: "c:/windows/fonts/CAMBRIAI.TTF",
- boldItalic: "c:/windows/fonts/CAMBRIAZ.TTF"
- },
- {
- name: "monospaced",
- regular: "c:/windows/fonts/consola.ttf",
- bold: "c:/windows/fonts/consolab.ttf",
- italic: "c:/windows/fonts/consolai.ttf",
- boldItalic: "c:/windows/fonts/consolaz.ttf"
- }
- */
- ],
- pageStyle: {
- //values: 0, 90, 180, 270
- //usually has no visual effect, only PDF internals are different
- pageRotation: "0",
- // PRS-500/505/600/700/650 Portrait
- //pageWidth: "88.184mm",
- //pageHeight: "113.854mm",
- // PRS-500/505/600/700/650 Landscape
- //pageWidth: "118.384mm",
- //pageHeight: "83.654mm",
- // PRS-300/350 Portrait
- //pageWidth: "74.168mm",
- //pageHeight: "95.758mm",
- // PRS-300/350 Landscape
- //pageWidth: "99.568mm",
- //pageHeight: "70.358mm",
- // PRS-900/950 Portrait
- //pageWidth: "88.184mm",
- //pageHeight: "147.678mm",
- // PRS-900/950 Landscape
- //pageWidth: "152.208mm",
- //pageHeight: "83.654mm",
- // PRS-900/950 Landscape 2-column
- //pageWidth: "75.802mm",
- //pageHeight: "83.654mm",
- // Kindle 3/4 Portrait (calculated from 560x735 pixels of 0.151mm; another variant is 85.09mm x 111.76mm, yet another variant is 85.5mm x 112.3mm)
- pageWidth: "84.560mm",
- pageHeight: "110.985mm",
- // Kindle 3/4 Landscape (calculated from 722x535 pixels of 0.151mm)
- //pageWidth: "109.022mm",
- //pageHeight: "80.785mm",
- // Kindle DX Portrait
- //pageWidth: "132.757mm",
- //pageHeight: "194.733mm",
- // Kindle DX Landscape
- //pageWidth: "196.427mm",
- //pageHeight: "131.064mm",
- marginLeft: "1.0pt",
- marginRight: "1.0pt",
- marginTop: "-2.0pt",//"0.0pt",
- marginBottom: "0.0pt",//"1.0pt",
- imageExtraMargins: "10pt",
- marginMirroring: "false",
- sectionNewPage: {
- "0": 1.0,
- "1": 0.5
- },
- backgroundColor: "",
- backgroundImage: "",
- header: {
- enabled: "false",
- dynamic: "true",
- //chapterTitle: "(ancestor-or-self::section)[2]/title//*[name()!='a']/text()",
- //chapterTitle: "string-join(ancestor-or-self::section/title[.//text()[matches(., '[^\\d\\s]')]]//*[name()!='a']/text(), '. ')",
- chapterTitle: "replace(string-join(ancestor-or-self::section/title//*[name()!='a']/text(), '. '), '([^\\s\\w])\\. ', '$1 ')",
- leftOdd: {
- enabled: "true",
- style: "headerLeft",
- border: 2, // TOP = 1; BOTTOM = 2; LEFT = 4; RIGHT = 8; NO_BORDER = 0; BOX = TOP + BOTTOM + LEFT + RIGHT;
- borderColor: "0x000000",
- // There are predefined variables $bookTitle, $authorFullName, $authorLastName, $authorFirstLastName, $authorFirstInitialLastName, $authorAllInitialsLastName
- // There are predefined dynamic variables $pageNum, $chapterTitle
- // There are predefined custom functions fb:cut-right(string, length) fb:cut-left(string, length)
- // There are standard xquery functions http://www.w3schools.com/xpath/xpath_functions.asp
- //query: "string-join(($authorFirstLastName, $bookTitle), ', ')"
- query: "fb:cut-right($authorFirstLastName, 30)"
- },
- centerOdd: {
- enabled: "false"
- },
- rightOdd: {
- enabled: "true",
- style: "headerRight",
- query: "fb:cut-right($bookTitle, 30)"
- },
- leftEven: {
- enabled: "true",
- query: "fb:cut-right($chapterTitle, 45)"
- },
- centerEven: {
- enabled: "false"
- },
- rightEven: {
- enabled: "true",
- style: "headerRight",
- query: "$pageNum"
- }
- },
- enforcePageSize: "true",//"false",
- pageSizeEnforcerColor: "0xededed",//"0x7F7F7F",
- footnotes: "true",//"false",
- footnotesMaxLines: 16,//7,
- footnoteMaxLines: 999,
- tableCellsAutoWidth: false,
- preventWidows: "true"
- },
- hyphenationSettings: {
- defaultLanguage: "ru",
- hyphenate: "true",
- overrideLanguage: "false"
- },
- transformationSettings: {
- enabled: "true",//"false",
- outputDebugFile: "false",
- queryProlog: "declare default element namespace \"http://www.gribuser.ru/xml/fictionbook/2.0\"; declare namespace l = \"http://www.w3.org/1999/xlink\"; ",
- morpherProlog: "declare default element namespace \"http://www.gribuser.ru/xml/fictionbook/2.0\"; declare namespace l = \"http://www.w3.org/1999/xlink\"; ",
- transformationsMap: [
- /*
- { // make digits superscript in notes (depends on font)
- "query": "//a[@type='note']/text()",
- "morpher": "translate(., '0123456789', '\u2070\u00B9\u00B2\u00B3\u2074\u2075\u2076\u2077\u2078\u2079')"
- },
- */
- /*
- { // delete dash (with following space) when dash is first character of first paragraph of the section
- "query": "//p[1]/text()",
- "morpher": "replace(., '^(\u2012|\u2013|\u2014|\u2015)(\u00A0|\\s)*', '')"
- },
- */
- /*
- { //delete bracket at the end of the text node
- "query": "//text()[ends-with(., '[')]",
- "morpher": "replace(., '(.*)\\[$', '$1')"
- },
- { //delete bracket at the beginning of the text node
- "query": "//text()[starts-with(., ']')]",
- "morpher": "replace(., '^\\](.*)', '$1')"
- },
- */
- /*
- { // convert poem note to paragraphs, part 1
- "query": "//body[@name='notes']//section/poem",
- "morpher": ".//stanza/*"
- },
- { // convert poem note to paragraphs, part 2
- "query": "//body[@name='notes']//section/v",
- "morpher": "<p>{./* | text()}</p>"
- },
- */
- //!
- { //convert *-marked comments to notes
- "query": "//a/sup[text() = '*']",
- "morpher": "(<sup>{replace(string(./../@l:href), '#c_', '')}</sup>, attribute {'type'} {'note'})"
- },
- //i
- /*
- { // delete links with empty href
- "query": "//a[@l:href='']",
- "morpher": "()"
- },
- */
- //!
- { // merge notes bodies, part 1
- "query": "//body[@name='notes']",
- "morpher": "<body name='notes'>{//body[@name='notes' or @name='footnotes']/*}</body>"
- },
- { // merge notes bodies, part 2
- "query": "//body[@name='footnotes']",
- "morpher": "()"
- },
- //i
- /*
- { // fix image-wrapped-in-paragraph
- "query": "//p[exists(image) and count(*) = 1]",
- "morpher": "./*"
- },
- */
- /*
- { // convert table cells to paragraphs
- "query": "//td",
- "morpher": "<p>{./* | text()}</p>"
- },
- { // convert table headers to paragraphs
- "query": "//th",
- "morpher": "<p>{./* | text()}</p>"
- },
- { // remove table rows
- "query": "//tr",
- "morpher": "./*"
- },
- { // remove table
- "query": "//table",
- "morpher": "./*"
- },
- */
- /*
- { //add empty title to the sections without title
- "query": "//section[empty(./title)]/*[position()=1]",
- "morpher": "(<title><p/></title>,.)"
- },
- */
- //!
- { // remove square brackets from note link
- "query": "//a[@type='note']/text()",
- "morpher": "replace(., '[\\[\\]]', '')"
- },
- //i
- /*
- { // remove word "note" from note link
- "query": "//a[@type='note']/text()",
- "morpher": "replace(., 'note', '')"
- },
- */
- /*
- { // remove extra spaces from note link
- "query": "//a[@type='note']/text()",
- "morpher": "normalize-space(.)"
- },
- */
- //!
- { // make note links superscript
- "query": "//a[(@type='note' or @type='comment') and not(parent::sup or child::sup)]/text()",
- "morpher": "<sup>{.}</sup>"
- },
- //i
- /*
- { // replace note link with note text
- "query": "//a[@type='note']",
- "morpher": "declare variable $hid := ./@l:href; <emphasis> [{//body[@name='notes']//section[@id=substring($hid,2)]/*[local-name()!='title']}]</emphasis>"
- },
- */
- /*
- { // get rid of superscript inside note link
- "query": "//a[@type='note']//sup",
- "morpher": "./* | text()"
- },
- */
- /*
- { // get rid of superscript outside note link
- "query": "//sup[./a[@type='note']]",
- "morpher": "./a"
- },
- */
- /*
- { //replace emphasis inside cite with it's text
- "query": "//cite//emphasis",
- "morpher": "./text()"
- },
- */
- /*
- { //remove images
- "query": "//image",
- "morpher": "()"
- },
- */
- /*
- { // wrap notes body content in two sections, making notes third-level section
- "query": "//body[@name='notes']",
- "morpher": "<body name='notes'><section><section>{./*}</section></section></body>"
- },
- */
- /*
- { // add new line before and after "code"
- "query": "//code",
- "morpher": "<code>{('\n', ./* | text(), '\n')}</code>"
- },
- */
- /*
- { // replace a single root section of nameless (main) body with it's content
- "query": "//body[empty(@name) and count(section) = 1]/section",
- "morpher": "./*"
- },
- */
- ]
- },
- textPreprocessorSettings: {
- enabled: "true",
- makeEndUnbreakable: "false",
- makeReplacements: "true",
- replacementsMap: {
- //"\"(.*?)\"": "«$1»", //replacing quotes
- " \u2012 ": "\u00A0\u2012 ",
- " \u2013 ": "\u00A0\u2013 ",
- " \u2014 ": "\u00A0\u2014 ",
- " \u2015 ": "\u00A0\u2015 ",
- " \u2212 ": "\u00A0\u2212 ",
- " \u2010 ": "\u00A0\u2010 ",
- " \u002D ": "\u00A0\u002D "
- //below is commented out because doesn't look good on narrow page
- /*
- " \u0430 ": " \u0430\u00A0",
- " \u0432 ": " \u0432\u00A0",
- " \u0438 ": " \u0438\u00A0",
- " \u043A ": " \u043A\u00A0",
- " \u043E ": " \u043E\u00A0",
- " \u0441 ": " \u0441\u00A0",
- " \u0443 ": " \u0443\u00A0",
- " \u0410 ": " \u0410\u00A0",
- " \u0411\u0435\u0437 ": " \u0411\u0435\u0437\u00A0",
- " \u0412 ": " \u0412\u00A0",
- " \u0412\u043E ": " \u0412\u043E\u00A0",
- " \u0414\u0430 ": " \u0414\u0430\u00A0",
- " \u0414\u043E ": " \u0414\u043E\u00A0",
- " \u0414\u043B\u044F ": " \u0414\u043B\u044F\u00A0",
- " \u0417\u0430 ": " \u0417\u0430\u00A0",
- " \u0418 ": " \u0418\u00A0",
- " \u0418\u0437 ": " \u0418\u0437\u00A0",
- " \u0418\u043B\u0438 ": " \u0418\u043B\u0438\u00A0",
- " \u041A ": " \u041A\u00A0",
- " \u041A\u043E ": " \u041A\u043E\u00A0",
- " \u041A\u0430\u043A ": " \u041A\u0430\u043A\u00A0",
- " \u041D\u0430 ": " \u041D\u0430\u00A0",
- " \u041D\u043E ": " \u041D\u043E\u00A0",
- " \u041D\u0430\u0434 ": " \u041D\u0430\u0434\u00A0",
- " \u041F\u043E ": " \u041F\u043E\u00A0",
- " \u041F\u043E\u0434 ": " \u041F\u043E\u0434\u00A0",
- " \u041F\u0440\u0438 ": " \u041F\u0440\u0438\u00A0",
- " \u041E ": " \u041E\u00A0",
- " \u041E\u0442 ": " \u041E\u0442\u00A0",
- " \u0420\u0430\u0437 ": " \u0420\u0430\u0437\u00A0",
- " \u0421 ": " \u0421\u00A0",
- " \u0422\u0430\u043A ": " \u0422\u0430\u043A\u00A0",
- " \u0422\u043E ": " \u0422\u043E\u00A0",
- " \u0422\u0443\u0442 ": " \u0422\u0443\u0442\u00A0",
- " \u0423 ": " \u0423\u00A0",
- " \u0427\u0435\u043C ": " \u0427\u0435\u043C\u00A0",
- " \u0427\u0442\u043E ": " \u0427\u0442\u043E\u00A0"
- */
- }
- },
- paragraphStyles: [
- {
- name: "default",
- fontFamily: "sansSerif",
- color: "0x000000",
- strokeWidth: "0.0",
- characterSpacing: "0.0",
- horizontalScaling:"1.0",
- inlineImageZoom: "1.0",
- inlineImageOffsetY: "0.0",
- fontSize: "9.0pt"//"11.0pt"
- },
- {
- comment: "Front matter style: authors, publishers, uuid, creator tool",
- name: "frontMatter",
- baseStyle: "default",
- fontSize: "7.0pt"
- },
- {
- name: "title",
- baseStyle: "default",
- fontStyle: "bold",
- fontSize: "14.0pt",//"16.0pt",
- alignment: "center"
- },
- {
- name: "subtitle",
- baseStyle: "default",
- fontSize: "10.0pt",//"12.0pt",
- alignment: "center"
- },
- {
- name: "author",
- baseStyle: "default",
- fontSize: "12.0pt",//"14.0pt",
- alignment: "center"
- },
- {
- name: "tocTitle",
- baseStyle: "default",
- fontSize: "14.0pt",//"16.0pt",
- alignment: "center",
- spacingAfter: "1em",
- text: "\u0421\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435"
- },
- {
- name: "tocItem",
- baseStyle: "default",
- fontSize: "10.0pt",//"12.0pt",
- fontStyle: "bold",
- leftIndent: "2.0em",
- firstLineIndent: "-2.0em"
- },
- {
- name: "annotation",
- baseStyle: "default",
- fontFamily: "serif",
- fontSize: "9.0pt",
- alignment: "justified",
- firstSpacingBefore: "0.3em",
- spacingAfter: "0.3em"
- },
- {
- name: "annotationSubtitle",
- baseStyle: "annotation",
- fontFamily: "sansSerif",
- fontStyle: "bold",
- alignment: "center",
- spacingBefore: "0.3em",
- spacingAfter: "0.3em"
- },
- {
- name: "bodyTitle",
- baseStyle: "default",
- fontSize: "14.0pt",//"16.0pt",
- fontStyle: "bold",
- alignment: "center",
- lastSpacingAfter: "0.6em",
- disableHyphenation: "true"
- },
- {
- name: "sectionTitle",
- baseStyle: "default",
- fontSize: "14.0pt",//"16.0pt",
- fontStyle: "bold",
- alignment: "center",
- lastSpacingAfter: "0.6em",
- disableHyphenation: "true"
- },
- {
- name: "subSectionTitle",
- baseStyle: "default",
- fontSize: "12.0pt",//"14.0pt",
- fontStyle: "bold",
- alignment: "center",
- spacingBefore: "0.6em",//"0.3em",
- firstSpacingBefore: "0.6em",
- lastSpacingAfter: "0.6em",
- disableHyphenation: "true"
- },
- {
- name: "subSubSectionTitle",
- baseStyle: "default",
- fontSize: "12.0pt",//"12.0pt",
- fontStyle: "bold",
- alignment: "center",
- disableHyphenation: "true"
- },
- {
- name: "poem",
- baseStyle: "default",
- fontFamily: "serif",
- fontSize: "9.3pt",//"11.0pt",
- fontStyle: "italic",
- leftIndent: "5.0em",
- firstLineIndent: "0em",
- firstFirstLineIndent: "0em",
- firstSpacingBefore: "0.5em",
- lastSpacingAfter: "0.5em"
- },
- /*
- {
- name: "poemAuthor",
- selector: "//poem/text-author"
- },
- */
- /*
- {
- name: "poemTitle",
- selector: "//poem/title"
- },
- */
- /*
- {
- name: "poemDate",
- selector: "//poem/date"
- },
- */
- {
- name: "epigraph",
- baseStyle: "default",
- fontFamily: "serif",
- fontSize: "9.3pt",//"11.0pt",
- fontStyle: "italic",
- leftIndent: "2.5em",
- firstSpacingBefore: "0.5em",
- lastSpacingAfter: "0.5em"
- },
- /*
- {
- name: "epigraphAuthor",
- selector: "//epigraph/text-author"
- },
- */
- {
- name: "cite",
- baseStyle: "epigraph"
- },
- {
- name: "citeSubtitle",
- selector: "//cite/subtitle",
- fontStyle: "boldItalic"
- },
- /*
- {
- name: "citeAuthor",
- selector: "//cite/text-author"
- },
- */
- {
- name: "body",
- baseStyle: "default",
- fontFamily: "serif",
- fontSize: "9.6pt",//"10.5pt", mydost "9.3pt", mom "11.3"
- alignment: "justified",
- firstLineIndent: "1.5em",
- leading: "1.35em",//есть оптимальная пропорция с fontSize,"1.2em"
- firstFirstLineIndent: "1.5em",//"0em",
- dropcapStyle: ""//"bodyDropCap"
- },
- {
- name: "header",
- baseStyle: "default",
- fontFamily: "serif",
- fontSize: "8pt",
- fontStyle: "italic",
- spacingAfter: "3pt",
- spacingBefore: "0pt",
- leftIndent: "3pt",
- rightIndent: "3pt"
- },
- {
- name: "headerLeft",
- baseStyle: "header",
- alignment: "left"
- },
- {
- name: "headerRight",
- baseStyle: "header",
- alignment: "right"
- },
- {
- name: "code",
- selector: "//code",
- fontFamily: "monospaced"
- },
- {
- name: "codeParagraph",
- selector: "//p[code and count(*) = 1 and empty(text())]",
- baseStyle: "body",
- fontFamily: "monospaced",
- fontSize: "6.0pt",
- alignment: "left",
- disableHyphenation: "true",
- preserveWhitespaces: "true",
- dropcapStyle: ""
- },
- /*
- {
- name: "anchor",
- selector: "//a[@type='note']",
- fontFamily: "sansSerif"
- },
- */
- {
- name: "table",
- baseStyle: "body",
- leftIndent: "0.5em",
- rightIndent: "0.5em",
- spacingBefore: "0.5em",
- spacingAfter: "0.5em"
- },
- {
- name: "tableTD",
- baseStyle: "body"
- },
- {
- name: "tableTH",
- baseStyle: "body",
- fontStyle: "bold"
- },
- {
- name: "footnote",
- baseStyle: "default",
- fontFamily: "sansSerif",
- fontSize: "7.0pt",//"7.5pt",
- alignment: "justified",
- firstFirstLineIndent: "0pt",
- firstLineIndent: "1em",
- leading: "1.1em",
- dropcapStyle: ""
- },
- {
- name: "bodyDropCap",
- baseStyle: "default",
- enabled: "true",
- fontFamily: "serif",
- fontSize: "26.0pt",
- fontStyle: "regular",
- spacingBefore: "6.6pt",
- spacingAfter: "1.0pt"
- },
- {
- name: "bodySubtitle",
- baseStyle: "default",
- fontFamily: "sansSerif",
- fontSize: "11.0pt",//"13.0pt",
- fontStyle: "bold",
- alignment: "center",
- spacingBefore: "0.3em",
- spacingAfter: "0.3em",
- firstSpacingBefore: "0.2em" //no in default
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement