html - 智能 y 坐标使具有打字效果的文本垂直对齐
问题描述
我正在为打字效果做动画。这是我的 ffmpeg 字符串:
-i ffmpeg_inputs/output-onlinegiftools.gif -vf "[in]drawtext=fonts/RobotoMono-Regular.ttf:text='h':fontcolor=orange:fontsize=35:x=(w-text_w)/2-200+0:y=h-th-400:enable='between(t,0.00, 7.80)', drawtext =fonts/RobotoMono-Regular.ttf:text = 'i':fontcolor=orange:fontsize=35:x=(w-text_w)/2-200+25:y=h-th-400:enable='between(t,0.80, 7.80)', drawtext =fonts/RobotoMono-Regular.ttf:text = 'g':fontcolor=orange:fontsize=35:x=(w-text_w)/2-200+75:y=h-th-400:enable='between(t,1.60, 7.80)', drawtext =fonts/RobotoMono-Regular.ttf:text = 'u':fontcolor=orange:fontsize=35:x=(w-text_w)/2-200+100:y=h-th-400:enable='between(t,2.40, 7.80)', drawtext =fonts/RobotoMono-Regular.ttf:text = 'y':fontcolor=orange:fontsize=35:x=(w-text_w)/2-200+125:y=h-th-400:enable='between(t,3.20, 7.80)', drawtext =fonts/RobotoMono-Regular.ttf:text = 's':fontcolor=orange:fontsize=35:x=(w-text_w)/2-200+150:y=h-th-400:enable='between(t,4.00, 7.80)'[out]" ffmpeg_outputs/test2.gif -y
以下是不同 y 值的结果:
据我了解,为了使句子流畅,对于某些字母我需要顶部垂直对齐,而对于其他字母我需要底部垂直对齐。我怎样才能使这种“智能对齐”,或者唯一的一种方法是硬编码不同字母的 y 值?
解决方案
推荐阅读
- xml - 无法弄清楚如何更改 PowerShell 脚本生成的 XML 节点值
- c# - Lucene.net 构建索引时 CPU 使用率高
- python - 如何将列表列表中的值存储到python中的单独列表中?
- reactjs - 使用索环单击时更改按钮标签?
- python - 如何使我的 python 脚本不那么滞后?
- php - 如何检查一个类别是否有父 WooComerce
- adaptive-cards - 如何使用自适应卡片行映射 JSON 数组 - 使用 Designer 创建模板
- c# - 我可以使用 LINQ 比较两个数组中的范围吗?
- reactjs - 使用 Reactjs 构建查找我的手机网站
- reactjs - 创建动态表