⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fontattribute.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setBold(true); baseText.setFontAttribute(10,18,font); System.out.println("字体是否设置粗体:"+font.getBold()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/style/font/FontAttribute.html#setBold(boolean)"><CODE>setBold(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getCharacterPosition()"><!-- --></A><H3>
getCharacterPosition</H3>
<PRE>
public float <B>getCharacterPosition</B>()</PRE>
<DL>
<DD>获得字符缩放位置。(注:仅文字处理和幻灯片演示有效)
<P>
<DD><DL>

<DT><B>返回:</B><DD>字符缩放位置,,取值范围为0 ~ 1584磅,如果返回值为9999999表示当前字体属性为三态 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setCharacterPosition(3.0f); baseText.setFontAttribute(10,18,font); float position = font.getCharacterPosition(); System.out.println("字符间距缩放位置为:" + position); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/style/font/FontAttribute.html#setCharacterPosition(float)"><CODE>setCharacterPosition(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getCharacterPositionType()"><!-- --></A><H3>
getCharacterPositionType</H3>
<PRE>
public int <B>getCharacterPositionType</B>()</PRE>
<DL>
<DD>获得字符缩放位置类型。(注:仅文字处理和幻灯片演示有效)
<P>
<DD><DL>

<DT><B>返回:</B><DD>字符缩放位置类型,如果返回值为9999999表示当前字体属性为三态 <p> 以下为常量类型: FontStyleEffectConstants.CHARACTER_POSITION_NORMAL   字符位置标准 FontStyleEffectConstants.CHARACTER_POSITION_INCREASE 字符位置提升 FontStyleEffectConstants.CHARACTER_POSITION_DECREASE 字符位置降低 </p> <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setCharacterPosition(3.0f); baseText.setFontAttribute(10,18,font); int type = font.getCharacterPositionType(); System.out.println("字符间距缩放位置类型为:" + type); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/constants/FontStyleEffectConstants.html" title="application.constants 中的接口"><CODE>FontStyleEffectConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getCharacterScale()"><!-- --></A><H3>
getCharacterScale</H3>
<PRE>
public float <B>getCharacterScale</B>()</PRE>
<DL>
<DD>获得字符间距缩放比例。(注:仅文字处理和幻灯片演示有效)
<P>
<DD><DL>

<DT><B>返回:</B><DD>字符间距缩放比例,,取值范围为0.01f~6.0f之间。如果返回值为9999999表示当前字体属性为三态 (注:2.0 表示 200% , 0.1 表示 10%)   <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setCharacterScale(2.0f); baseText.setFontAttribute(10,18,font); float scale = font.getCharacterScale(); System.out.println("字符间距缩放比例为:" + scale); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/style/font/FontAttribute.html#setCharacterScale(float)"><CODE>setCharacterScale(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getCharacterSpacing()"><!-- --></A><H3>
getCharacterSpacing</H3>
<PRE>
public float <B>getCharacterSpacing</B>()</PRE>
<DL>
<DD>获得字符间距缩放间距。(注:仅文字处理和幻灯片演示有效)
<P>
<DD><DL>

<DT><B>返回:</B><DD>字符间距缩放间距,,取值范围为0 ~ 1584磅。如果返回值为9999999表示当前字体属性为三态 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setCharacterSpacingType(FontStyleEffectConstants.CHARACTER_SPACING_EXTEND); font.setCharacterSpacing(4.0f); baseText.setFontAttribute(10,18,font); float spacing = font.getCharacterSpacing(); System.out.println("字符间距缩放间距为:" + spacing); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/style/font/FontAttribute.html#setCharacterSpacing(float)"><CODE>setCharacterSpacing(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getCharacterSpacingType()"><!-- --></A><H3>
getCharacterSpacingType</H3>
<PRE>
public int <B>getCharacterSpacingType</B>()</PRE>
<DL>
<DD>获得字符间距缩放间距类型(注:仅文字处理和幻灯片演示有效)
<P>
<DD><DL>

<DT><B>返回:</B><DD>字符间距缩放间距类型,如果返回值为9999999,表示当前字体属性为三态 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setCharacterSpacingType(FontStyleEffectConstants.CHARACTER_SPACING_EXTEND); font.setCharacterSpacing(4.0f); baseText.setFontAttribute(10,18,font); System.out.println(font.getCharacterSpacingType()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/constants/FontStyleEffectConstants.html" title="application.constants 中的接口"><CODE>FontStyleEffectConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getComplexFontName()"><!-- --></A><H3>
getComplexFontName</H3>
<PRE>
public java.lang.String <B>getComplexFontName</B>()</PRE>
<DL>
<DD>获得复杂字体名称。
<P>
<DD><DL>

<DT><B>返回:</B><DD>字体名称 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setComplexFontName("Roman"); baseText.setFontAttribute(10,18,font); String fontName = font.getComplexFontName(); System.out.println("得到原来设置的复杂字体名称为: " + fontName); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getComplexFontSize()"><!-- --></A><H3>
getComplexFontSize</H3>
<PRE>
public double <B>getComplexFontSize</B>()</PRE>
<DL>
<DD>获得复杂字体大小。
<P>
<DD><DL>

<DT><B>返回:</B><DD>字体的大小 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setComplexFontSize(24); baseText.setFontAttribute(10,18,font); System.out.println("得到复杂字体大小为:" + font.getComplexFontSize()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getComplexFontStyle()"><!-- --></A><H3>
getComplexFontStyle</H3>
<PRE>
public int <B>getComplexFontStyle</B>()</PRE>
<DL>
<DD>返回复杂字体类型。
<P>
<DD><DL>

<DT><B>返回:</B><DD>style 字体类型,使用java.awt.Font类中常量。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setComplexFontStyle(java.awt.Font.BOLD); baseText.setFontAttribute(10,18,font); System.out.println("字体类型:"+font.getComplexFontStyle()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getDot()"><!-- --></A><H3>
getDot</H3>
<PRE>
public int <B>getDot</B>()</PRE>
<DL>
<DD>判断是否有着重号。(注:仅文字处理和幻灯片演示有效)
<P>
<DD><DL>

<DT><B>返回:</B><DD>如果为1表示有着重号;0表示无;如果为9999999表示当前字体属性为三态 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setDot(true);  baseText.setFontAttribute(10,18,font); System.out.println("字体是否有着重号:"+font.getDot());</DL>
</DD>
</DL>
<HR>

<A NAME="getDoubleStrikeThrough()"><!-- --></A><H3>
getDoubleStrikeThrough</H3>
<PRE>
public int <B>getDoubleStrikeThrough</B>()</PRE>
<DL>
<DD>判断字体是否设置了双删除线效果。
<P>
<DD><DL>

<DT><B>返回:</B><DD>如果字体设置了双删除线效果,则返回1;否则,返回0;如果返回值为9999999表示当前字体属性为三态 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); BaseText baseText = section.getBaseText(); baseText.insertText(0,"this is a test!\nthis is a test!\n"); FontAttribute font = new FontAttribute(); font.setDoubleStrikeThrough(true); baseText.setFontAttribute(10,18,font); System.out.println("字体是否设置为双删除线:"+font.getDoubleStrikeThrough()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/style/font/FontAttribute.html#setDoubleStrikeThrough(boolean)"><CODE>setDoubleStrikeThrough(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getEmboss()"><!-- --></A><H3>
getEmboss</H3>
<PRE>
public int <B>getEmboss</B>()</PRE>
<DL>
<DD>判断字体是否设置了阳文效果。
<P>
<DD><DL>

<DT><B>返回:</B><DD>如果字体设置了阳文效果,则返回1;否则,返回0;如果返回值为9999999表示当前字体属性为三态 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -