当前位置:网站首页>Kivy教程之 格式化文本 (教程含源码)
Kivy教程之 格式化文本 (教程含源码)
2022-07-04 03:53:00 【知识大胖】
格式化文本
最多流行和普遍使用的标记语言毫无疑问是HTML。另一方面,Kivy 实现了 BBCode 的变体,这是一种曾经用于格式化许多留言板上的帖子的标记语言。与 HTML 的明显区别在于 BBCode 使用方括号作为标签分隔符。
这Kivy 中提供了以下标签:

为了实现所需的格式(小时为粗体,其余文本为fn_regular细字体),我们可以使用以下代码:
Label:
text: '[b]00[/b]:00:00'
markup: True
实战代码

from kivy.app import App
from kivy.lang import Builder
# File: clock.kv
KV = '''
BoxLayout:
orientation: 'vertical'
Label:
text: 'normal:11:00:00'
Label:
text: 'format:[b]00[/b]:00:00'
markup: True
'''
class ClockApp(App):
def build(self):
return Builder.load_string(KV)
if __name__ 边栏推荐
- leetcode 121 Best Time to Buy and Sell Stock 买卖股票的最佳时机(简单)
- 沃博联结束战略评估,决定保留表现优异的博姿业务
- 【微服务|openfeign】@FeignClient详解
- Redis: operation command for collecting set type data
- [microservice openfeign] @feignclient detailed explanation
- Wechat official account infinite callback authorization system source code
- 虚拟商品帐号交易平台源码_支持个人二维码收款
- Why use node
- Rhcsa 06 - suid, sgid, sticky bit (to be added)
- Katalon uses script to query list size
猜你喜欢

Ppt tutorial, how to save a presentation as a PDF file in PowerPoint?

旭化成首次参展第五届中国国际进口博览会(5th CIIE)

Exercises in quantum mechanics

Application scheme of Puyuan ds1000z series digital oscilloscope in communication principle experiment

统计遗传学:第三章,群体遗传

疫情远程办公经验分享| 社区征文

Emlog用户注册插件 价值80元

leetcode:1314. 矩阵区域和【二维前缀和模板】

Wechat brain competition answer applet_ Support the flow main belt with the latest question bank file

最长递增子序列问题(你真的会了吗)
随机推荐
Krypton saikr daily question - CTF
Leetcode skimming: binary tree 08 (maximum depth of n-ary tree)
ctf-pikachu-XSS
C language bidirectional linked list first edition
什么是上下文?
Leetcode 121 best time to buy and sell stock (simple)
Select function variable column name in dplyr of R language
多位科技公司创始人向Entrepreneur First提供高达1.58亿美元的C轮融资,协助其投资下一代全球创新者
Programmers' telecommuting is mixed | community essay solicitation
R语言中如何查看已安装的R包
TCP-三次握手和四次挥手简单理解
Understand the principle of bytecode enhancement technology through the jvm-sandbox source code
FT2000+下LPC中断绑核使用说明
Emlog user registration plug-in is worth 80 yuan
Graduation project: design seckill e-commerce system
Modstartblog modern personal blog system v5.2.0 source code download
leetcode刷题:二叉树08(N叉树的最大深度)
Operation of ES6
One click compilation and deployment of MySQL
普源DS1000Z系列数字示波器在通信原理实验中的应用方案