书封面-核心-模式参考
部分 封套 一代系统。
这是核心生成器包-不直接使用。安装
bookcover-node 为Node.js或
bookcover-web 对于浏览器。
本文档描述了两者接受的模式。
所有颜色必须是HSL字符串的格式 hsl(200deg, 50%, 30%).
打印/尺寸
| 场 | 类型 | 笔记 |
service_id | string | 印刷服务: kdp, lulu, officeworks, vistaprint_au, ctrlprint |
binding_type | string | 如。 paperback, hardcover -视乎服务而定 |
size_id | string? | 如。 us_trade, a5 -省略如果使用自定义尺寸 |
page_count | number? | 使用时需要 size_id |
ink_type | string? | 如。 bw, color -某些服务需要 |
paper_type | string? | 如。 white, cream -某些服务需要 |
custom_unit | string? | mm 或者 in -用于自定义尺寸 |
custom_trim_width | number? | 内剪宽度 custom_unit |
custom_trim_height | number? | 纵倾高度 custom_unit |
custom_bleed | number? | 流血的 custom_unit |
custom_spine | number? | 脊宽 custom_unit |
margin_front | number? | 前面板文本边距为装饰高度的% |
margin_back | number? | 后面板文本边距为装饰高度的% |
标题
三个标题行(title1, title2, title3)每个人都有相同的一组选项。
title1 是主标题。
| 场 | 类型 | 笔记 |
title1 | string | 主标题(默认) '') |
title1_font | {family: string}? | 在Typst中使用的字体族名称 |
title1_size | number? | 相对大小乘数(默认1.0) |
title1_weight | number? | css样式的权重100-900(默认为700) |
title1_italic | boolean? | |
title1_color | hsl? | 默认为对比色vs bg_color |
title_alignment | center|left|right? | |
title_position | top|middle|bottom | 要求 |
title_spacing | number? | 标题行之间的间距占装饰高度的% |
title_margin_top | number? | 上边距为装饰高度的% |
title_margin_bottom | number? | 底部边距为装饰高度的% |
title2 和 title3 拥有相同的 _font, _size, _weight, _italic, _color 字段;
title2/title3 颜色默认为 title1_color.
副标题
| 场 | 类型 | 笔记 |
subtitle | string | (默认 '') |
subtitle_font | {family: string}? | |
subtitle_size | number? | |
subtitle_weight | number? | 100 - 900 |
subtitle_italic | boolean? | |
subtitle_color | hsl? | |
subtitle_alignment | center|left|right? | |
subtitle_position | top|middle|bottom | 要求 |
subtitle_spacing | number? | 副标题行之间的间距占裁边高度的% |
subtitle_margin_top | number? | |
subtitle_margin_bottom | number? | |
作者
| 场 | 类型 | 笔记 |
author | string | (默认 '') |
author_font | {family: string}? | |
author_size | number? | |
author_weight | number? | 100 - 900 |
author_italic | boolean? | |
author_color | hsl? | |
author_alignment | center|left|right? | |
author_position | top|middle|bottom | 要求 |
author_margin_top | number? | |
author_margin_bottom | number? | |
简介(后面板)
| 场 | 类型 | 笔记 |
blurb | string | 封底文字(默认) '') |
blurb_font | {family: string}? | |
blurb_size | number? | |
blurb_color | hsl? | |
blurb_bg_color | hsl|null? | undefined 源自于 bg_color; null =透明 |
blurb_alignment | center|left|right|justified? | |
blurb_padding | number? | 填充为装饰高度的% |
blurb_width | number? | 宽度为面宽的% |
blurb_spacing | number? | 行间距倍增器(1 =默认Typst前导) |
脊柱
如果没有设置,脊柱文本默认为前标题和作者。通过 '' 显式地
压制书脊文字。
| 场 | 类型 | 笔记 |
spine_title | string? | 省略派生自 title1; '' 抑制 |
spine_title_font | {family: string}? | |
spine_title_size | number? | |
spine_title_weight | number? | |
spine_title_italic | boolean? | |
spine_title_color | hsl? | |
spine_author | string? | 省略派生自 author; '' 抑制 |
spine_author_font | {family: string}? | |
spine_author_size | number? | |
spine_author_weight | number? | |
spine_author_italic | boolean? | |
spine_author_color | hsl? | |
spine_color | hsl|null? | null =没有单独的spine颜色(使用primary bg) |
背景
| 场 | 类型 | 笔记 |
bg_color | hsl? | 原色背景色 |
bg_color_gradient | boolean? | 背景渐变 |
bg_image_coverage | full|front|painted|feature|front_partial? | 背景图像是如何放置的 |
icon_id | string? | 图标化ID(例如: game-icons:sailboat)或原始SVG |
icon_mode | center|offset|echo|background? | |
icon_size | number? | 相对大小倍增器,范围0.25-4 |
icon_color | string? | |
icon_spine | boolean? | 显示脊柱上的图标 |
pattern | string? | 原始SVG字符串平铺作为背景图案 |
pattern_tile_mm | number? | 图案瓦片大小(mm)(默认80) |
pattern_color | string? | |
其他
| 场 | 类型 | 笔记 |
isbn | string | ISBN-13;在封底上生成条形码(默认) '') |