2021-04-25 宋体字号与英文磅值之间的转换

本文提供了一张详细的字号与磅值对照表,涵盖了从‘八号’到‘初号’的各种常用字体大小,便于排版和编辑时快速查阅。
字号‘八号’对应磅值5
字号‘七号’对应磅值5.5
字号‘小六’对应磅值6.5
字号‘六号’对应磅值7.5
字号‘小五’对应磅值9
字号‘五号’对应磅值10.5
字号‘小四’对应磅值12
字号‘四号’对应磅值14
字号‘小三’对应磅值15
字号‘三号’对应磅值16
字号‘小二’对应磅值18
字号‘二号’对应磅值22
字号‘小一’对应磅值24
字号‘一号’对应磅值26
字号‘小初’对应磅值36
字号‘初号’对应磅值42
<!-- 根模板 --> <xsl:template match="/"> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="3cm"> <fo:region-body margin-top="1cm" margin-bottom="1cm"/> <fo:region-before extent="1cm"/> <fo:region-after extent="1cm"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4"> <fo:flow flow-name="xsl-region-body" font-family="SimSun, 宋体" language="zh-CN" line-height="1.5"> <xsl:apply-templates select="//w:body"/> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <!-- 正文处理 --> <xsl:template match="w:body"> <xsl:apply-templates select="*"/> </xsl:template> <!-- 段落处理 ★修改核心区域★ --> <xsl:template match="w:p"> <fo:block font-size="12pt" space-after="12pt" linefeed-treatment="ignore" wrap-option="wrap" text-align="justify"> <!-- 添加动态对齐控制 --> <xsl:choose> <!-- 检测段落属性中的居中设置 --> <xsl:when test="w:pPr/w:jc[@w:val='center']"> <xsl:attribute name="text-align">center</xsl:attribute> </xsl:when> <!-- 可扩展其他对齐方式 --> <xsl:when test="w:pPr/w:jc[@w:val='right']"> <xsl:attribute name="text-align">end</xsl:attribute> </xsl:when> </xsl:choose> <xsl:apply-templates select="w:r"/> </fo:block> </xsl:template> <!-- 文本运行处理(完整颜色支持版) --> <xsl:template match="w:r"> <fo:inline font-family="SimSun, 宋体, Microsoft YaHei, sans-serif"> <!-- 颜色处理必须放在最前面 --> <xsl:if test="w:rPr/w:color"> <xsl:attribute name="color"> <xsl:call-template name="convertWordColor"> <xsl:with-param name="wordColor" select="w:rPr/w:color/@w:val"/> </xsl:call-template> </xsl:attribute> </xsl:if> <!-- 粗体处理 --> <xsl:if test="w:rPr/w:b"> <xsl:attribute name="font-family">SimHei, 黑体</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> </xsl:if> <!-- 斜体处理 --> <xsl:if test="w:rPr/w:i"> <xsl:attribute name="font-family">KaiTi, 楷体</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> </xsl:if> <!-- 实际文本内容 --> <xsl:value-of select="w:t"/> </fo:inline> </xsl:template> <!-- 颜色转换模板(XSLT 1.0兼容版) --> <xsl:template name="convertWordColor"> <xsl:param name="wordColor"/> <xsl:choose> <!-- 处理自动颜色 --> <xsl:when test="$wordColor = 'auto'">#000000</xsl:when> <!-- 处理8字符带透明度的情况(如FF0000FF) --> <xsl:when test="string-length($wordColor) = 8"> <xsl:value-of select="concat('#', substring($wordColor, 3, 6))"/> </xsl:when> <!-- 标准6字符HEX --> <xsl:when test="string-length($wordColor) = 6"> <xsl:value-of select="concat('#', $wordColor)"/> </xsl:when> <!-- 其他情况继承父级颜色 --> <xsl:otherwise>inherit</xsl:otherwise> </xsl:choose> </xsl:template>这个字体大小设置消失了,怎么修改,注意这是word.xml转xsl-fo的xslt脚本,且版本为1.0,请将修改好的代码提供出来
03-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值