首页 > 其他分享 >【他山之石】Leading-Trim: The Future of Digital Typesetting:数字排版的未来 —— Leading-Trim

【他山之石】Leading-Trim: The Future of Digital Typesetting:数字排版的未来 —— Leading-Trim

时间:2024-12-12 22:59:01浏览次数:5  
标签:Trim trim Leading Typesetting spacing leading height text CSS

文章目录

写在前面
本文是《CSS in Depth》全新第2版12.1节内容中提供的延伸阅读材料(详见我的 CSS 同名翻译专栏 【CSS in Depth 2 精译_073】)。由于没找到完整转载,特此整理,择日再翻译成中文,敬请关注!

【他山之石】Leading-Trim: The Future of Digital Typesetting:数字排版的未来 —— Leading-Trim

How an emerging CSS standard can fix old problems and raise the bar for web apps

by Ethan Wang, Aug 18, 2020 (9 min read)

fig12.8.1

1. The problem with text boxes today

In a standard text box, there’s almost always extra space above and below the actual text. Because of this, when you use a text box to measure and implement spacing, it ends up larger than you intended. The bigger the line height, the bigger the problem. The example below shows distances between text boxes set to 32px. As you can see, all the vertical spacing is visually much bigger than 32px, even though you set them all to the same value.

fig12.8.2

This is a common problem that spans tools and platforms. In my last Medium article, I talked about how I use the 4px baseline grid to measure spacing around text and achieve better visual accuracy. Knowing the imperfections of this approach, I kept searching for a better solution. Last June, I came across an emerging CSS feature spec called leading-trim. I’ve been working with the author of the spec, an expert from the W3C CSS Working Group, fantasai, to make sure Microsoft Design can be a part of this transformative work.

Today, we’re excited to announce that Microsoft Design is sponsoring the authoring of this new spec. This article gives an introduction to this new CSS standard, leading-trim, and what it could mean for web designers and developers.


2. How we got here: a history lesson

To understand how this became a problem, specifically on the web, we need to go back in the history of typography. Around 140 years ago, type was still set manually with individual lead boxes. To make text more readable, typesetters would put strips of lead to space lines out. (That’s where the word “leading” came from

标签:Trim,trim,Leading,Typesetting,spacing,leading,height,text,CSS
From: https://blog.csdn.net/frgod/article/details/144437844

相关文章

  • Trimble Business Center 2023.11(TBC2023.11)地理空间办公软件永久许可
    TrimbleBusinessCenter2023.11TrimbleBusinessCenter(TBC)是一个全面综合并可扩展的工具套件,能够用于各种地理空间业务。无论您的业务需要单机许可还是多用户企业许可,TrimbleBusinessCenter都可以为您提供灵活的选项,以满足您的不同需求。TrimbleBusinessCenter为当......
  • 手写一个trim()的方法
    functiontrim(str){//Checkiftheinputisastring.Ifnot,returntheinputasis.if(typeofstr!=='string'){returnstr;}//Usearegularexpressiontoremovewhitespacefrombothendsofthestring.returnstr.replace......
  • Request processing failed:MyBatisSystemException 黑马web开发课程P152中可能出现的
    该异常的最后一句,通过翻译,大概是:   [dispatcherServlet]:servlet.service()forservlet[dispatcherServlet]在路径[]的上下文中抛出异常[请求处理失败:MyBatisSystemException]    经过对代码的检查,发现controller,sevice,dao层业务逻辑都没有问题dao层的map......
  • Trimesh: 使用射线查询网格和点云
    射线查询是一种常见的几何计算任务,用于确定射线与物体(如网格和点云)的交点,在本文中我们将使用Trimesh库来演示如何使用射线查询功能,Trimesh是一个功能强大的Python库,用于处理和操作3D网格数据,展示如何使用Trimesh库进行射线查询,并提供相应的源代码示例。安装Trimesh库,您可以......
  • fastqc和Trimmomatic的使用
    1.FastQC分析检测报告在先前的记录中,我们已经得到了我们的QC报告,现在要针对我们的报告对原始数据进行过滤其中和都表明该数据需要去接头,并对序列进行处理2.Trimmomatic的下载首先,使用conda安装TrimmomaticcondainstallTrimmomatic就可以安装完毕了,安装完使用trimmomatic......
  • 字符串— trim()、trimStart() 和 trimEnd()
    在今天的教程中,我们将一起来学习JavaScript字符串trim()、trimStart()和trimEnd()。01、trim()学习如何使用JavaScript trim()方法从字符串的两端删除空格字符。JavaScripttrim()方法介绍String.prototype.trim()返回一个从字符串开头和结尾去除空白字符的新字符串:......
  • TypeError: Cannot read properties of undefined (reading 'trim')
     运行时提示:TypeError:Cannotreadpropertiesofundefined(reading'trim')问题排查:1、确认trim()属性是否存在,这个是js去除字符串左右空格,属性是存在的2、确认this.form.proxy_url是否存在3、确认确认this.form.proxy_url的值是否为undefined和null通过排查和打印,con......
  • v-model的修饰符( .number .trim .lazy)
    v-model的修饰符 .number的作用是将绑定的值从string类型变为number类型 在上述代码中,我们在input元素绑定了blur事件,作用为当鼠标移出当元素,触发该事件去响应方案 可以看到在鼠标移出后,控制台打印的number类型为string当我们再v-model后加上修饰符.number后 控制台......
  • Leading SAFe领导大规模敏捷认证课/SAFe认证Leading SAFe官方认证班
    课程简介 SAFe–ScaledAgileFramework是目前全球运用最广泛的大规模敏捷框架,也是全球敏捷相关认证成长最快、最被认可、最有价值的规模化敏捷认证,目前全球SAFe认证专业人士已达120万人。据官方统计,获得新证书的IT专业人士的平均工资增长13,000美元,其中78%的认证......
  • WPF的TextTrimming的属性
    WPF的TextTrimming="CharacterEllipsis"是一种文本修剪方式,用于在文本长度超过容器宽度时省略文本。它会在文本末尾添加省略号(...),同时保留尽可能多的字符。这种修剪方式通常用于UI设计中,以避免文本溢出并保持视觉美观。可以通过设置TextTrimming属性来指定文本的截断方式:Tex......