具备的方法

源码

class Font(object):"""Character properties object, providing font size, font name, bold,italic, etc. Corresponds to ``<a:rPr>`` child element of a run. Alsoappears as ``<a:defRPr>`` and ``<a:endParaRPr>`` in paragraph and``<a:defRPr>`` in list style elements."""def __init__(self, rPr):super(Font, self).__init__()self._element = self._rPr = rPr@propertydef bold(self):"""Get or set boolean bold value of |Font|, e.g.``paragraph.font.bold = True``. If set to |None|, the bold setting iscleared and is inherited from an enclosing shape's setting, or asetting in a style or master. Returns None if no bold attribute ispresent, meaning the effective bold value is inherited from a masteror the theme."""return self._rPr.b@bold.setterdef bold(self, value):self._rPr.b = value@lazypropertydef color(self):"""The |ColorFormat| instance that provides access to the color settingsfor this font."""if self.fill.type != MSO_FILL.SOLID:self.fill.solid()return self.fill.fore_color@lazypropertydef fill(self):"""|FillFormat| instance for this font, providing access to fillproperties such as fill color."""return FillFormat.from_fill_parent(self._rPr)@propertydef italic(self):"""Get or set boolean italic value of |Font| instance, with the samebehaviors as bold with respect to None values."""return self._rPr.i@italic.setterdef italic(self, value):self._rPr.i = value@propertydef language_id(self):"""Get or set the language id of this |Font| instance. The language idis a member of the :ref:`MsoLanguageId` enumeration. Assigning |None|removes any language setting, the same behavior as assigning`MSO_LANGUAGE_ID.NONE`."""lang = self._rPr.langif lang is None:return MSO_LANGUAGE_ID.NONEreturn self._rPr.lang@language_id.setterdef language_id(self, value):if value == MSO_LANGUAGE_ID.NONE:value = Noneself._rPr.lang = value@propertydef name(self):"""Get or set the typeface name for this |Font| instance, causing thetext it controls to appear in the named font, if a matching font isfound. Returns |None| if the typeface is currently inherited from thetheme. Setting it to |None| removes any override of the themetypeface."""latin = self._rPr.latinif latin is None:return Nonereturn latin.typeface@name.setterdef name(self, value):if value is None:self._rPr._remove_latin()else:latin = self._rPr.get_or_add_latin()latin.typeface = value@propertydef size(self):"""Read/write |Length| value or |None|, indicating the font height inEnglish Metric Units (EMU). |None| indicates the font size should beinherited from its style hierarchy, such as a placeholder or documentdefaults (usually 18pt). |Length| is a subclass of |int| havingproperties for convenient conversion into points or other lengthunits. Likewise, the :class:`pptx.util.Pt` class allows convenientspecification of point values::>> font.size = Pt(24)>> font.size304800>> font.size.pt24.0"""sz = self._rPr.szif sz is None:return Nonereturn Centipoints(sz)@size.setterdef size(self, emu):if emu is None:self._rPr.sz = Noneelse:sz = Emu(emu).centipointsself._rPr.sz = sz@propertydef underline(self):"""Read/write. |True|, |False|, |None|, or a member of the:ref:`MsoTextUnderlineType` enumeration indicating the underlinesetting for this font. |None| is the default and indicates theunderline setting should be inherited from the style hierarchy, suchas from a placeholder. |True| indicates single underline. |False|indicates no underline. Other settings such as double and wavyunderlining are indicated with members of the:ref:`MsoTextUnderlineType` enumeration."""u = self._rPr.uif u is MSO_UNDERLINE.NONE:return Falseif u is MSO_UNDERLINE.SINGLE_LINE:return Truereturn u@underline.setterdef underline(self, value):if value is True:value = MSO_UNDERLINE.SINGLE_LINEelif value is False:value = MSO_UNDERLINE.NONEself._element.u = value

pptx字体类的相关方法相关推荐

  1. CSS快速学习2:选择符权重和字体类属性

    选择符的权重: CSS中用四位数字表示权重. 类型选择符的权重为0001 class选择符的权重为0010 id选择符的权重为0100 子选择符的权重为0000 属性选择符的权重为0010 伪类选择符 ...

  2. 看一遍就能玩转QT字体类(2)-QFontDatabase

    目录 1.QFontDatabase概述 2.获取系统所有字体族信息 3.给应用程序添加可使用的字体 4.卸载添加的字体 5.判断指定字体是否具有某种属性或特征 6.获取支持中文抒写系统的字体 7.其 ...

  3. 字体和文本输出:CFont字体类

    字体简介 GDI(Graphics Device Interface),图形设备接口,是Windows提供的一些函数和结构,用于在显示器和打印机上显示图形.我们在MFC开发中经常会使用GDI来输出文本 ...

  4. VS2010-MFC(字体和文本输出:CFont字体类)

    转自:http://www.jizhuomi.com/software/239.html 字体简介 GDI(Graphics Device Interface),图形设备接口,是Windows提供的一 ...

  5. 【Java学习】Font字体类的用法介绍

    一.Font类简介 Font类是用于设置图形用户界面上的字体样式的,包括字体类型(例如宋体.仿宋.Times New Roman等).字体风格(例如斜体字.加粗等).以及字号大小. 二.Font类的引 ...

  6. File类及相关方法介绍

    File类 File类主要作用是对文件和目录的抽象表示,该类主要是对目录和文件进行创建.修改.删除.过滤等操作 File的构造器: File(String pathname) //将路径字符串实例化F ...

  7. 字体类形:font-family, font-style

    语法:{font-family:字体1,字体2,字体3,...}  作用:调用客户端字体 font-family: "Lantinghei SC","Microsoft ...

  8. Executors工具类的相关方法

    前言:大家好,我是小威,24届毕业生.本篇将记录创建线程池的Executors工具类里面的方法,方便加深知识印象和复习使用. 本篇文章记录的基础知识,适合在学Java的小白,也适合复习中,面试中的大佬

  9. 黑马毕向东Java课程笔记(day20-1——20-17)IO流:File类及相关方法、递归、递归的相关练习、Properties、PrintWriter类与PrintStream类、合并流与切割流

    1.File类概述   File是文件和目录路径名的抽象表示形式. 用来将文件或者文件夹封装成对象,方便对文件与文件夹的属性信息进行操作.   前面说到的"流",它只能操作数据,想 ...

最新文章

  1. c++ 线程池_基础篇:高并发一瞥,线程和线程池的总结
  2. 计算机模块考试注意事项,常考计算机模块考试操作注意事项.doc
  3. 《大话移动 APP 测试》
  4. id vue2路由传参_vue 路由跳转传参
  5. Linux 命令(48)—— stat 命令
  6. FFMPEG 库移植到 VC 需要的步骤
  7. ubuntu16.04下ROS操作系统学习笔记(二)命令工具了解和仿真小海龟
  8. CentOS 6系统FreeSwitch和RTMP服务 安装及演示(四)
  9. Cadence Allegro Vertex功能介绍使用方法Vertex与Slide的区别图文教程
  10. 生成均匀分布次序统计量的伪随机数 生成删失伪随机样本
  11. 支持P2P传输的M3U8播放器
  12. 螣龙安科入侵感知:防火墙有哪些缺陷?
  13. android高德地图多个mark点击,Android ---------高德卫星地图绘制多个点和点的点击事件自定义弹窗...
  14. TCP协议与UDP协议详解
  15. NPN三极管电平反向电路
  16. Modbus通信模式有哪几种?各自的特点有哪些?
  17. XDOC Office 7.5.0发布
  18. r7 4700u核显相当于什么显卡
  19. 锂电池充电管理IC/DP4056
  20. JVM架构和垃圾回收机制深入理解

热门文章

  1. Lemmy仿Reddit社区 v0.8.10源码
  2. python加密字符串小写字母循环后错两位_Python简单加密程序:如何将Z循环回
  3. discuz精仿OPPO社区主题模板
  4. easyui-super-theme后台模板
  5. 1对1直播系统-C135 直播源码-含安卓IOS双端
  6. 一款好看的html动态跳转页源码
  7. linux内核优化脚本,linux内核高级优化脚本
  8. 【变色龙】app封装系统源码+完美版在售封装系统
  9. wordpress模板-单栏整洁的个人博客Siren主题模板
  10. Vue系列vue-router的配置使用(一)