# 如何将字母头像个人资料上的字母对齐到中心？

**URL:** <https://meta.discourse.org/t/how-to-align-an-alphabet-on-letter-avatar-profile-to-the-center/200272>\
**Category:** Support\
**Created:** [2021年八月13日 02:16 UTC](https://meta.discourse.org/t/how-to-align-an-alphabet-on-letter-avatar-profile-to-the-center/200272 "2021-08-13T02:16:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![inherithandle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/inherithandle/32/230816_2.png) [@inherithandle](https://meta.discourse.org/u/inherithandle)\
**Post date:** [2021年八月13日 02:16 UTC](https://meta.discourse.org/t/how-to-align-an-alphabet-on-letter-avatar-profile-to-the-center/200272/1 "2021-08-13T02:16:38Z")

</div>

我论坛上的字母头像尺寸比 Discourse Meta 论坛上的大 2-3 倍，这导致字母略微向右对齐。我并未对 letter\_avatar.rb 进行任何修改：[discourse/lib/letter\_avatar.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/lib/letter_avatar.rb)

我论坛上的字母头像（120x120，2KB）：

 ![5_191a389ed3aaa6e59ca5241b90f6052e](https://global.discourse-cdn.com/meta/original/3X/6/a/6ae1fb93d82c2d59270b818b91a6c4a7b52a3845.png)

Discourse Meta 论坛上的字母头像（120x120，683 字节）：

 ![](https://global.discourse-cdn.com/meta/original/3X/b/b/bbd1aef04d1d668507f9d844f932f71663e6f489.png)

有人能告诉我如何将其居中对齐，或者如果你们认为较大的尺寸导致字母向右对齐，该如何减小图片尺寸吗？

---

<div class="post-metadata">

**Author:** ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)\
**Post date:** [2021年八月13日 20:17 UTC](https://meta.discourse.org/t/how-to-align-an-alphabet-on-letter-avatar-profile-to-the-center/200272/2 "2021-08-13T20:17:07Z")

</div>

这很奇怪！看起来完全是另一种字体。以下是 Meta 的 F 头像，供参考：

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/a/5af0108dde2906cf14ec9921584eef8dfe82b6ee.png) ![image](https://global.discourse-cdn.com/meta/original/3X/8/4/8456300294d40500e24427f9647c8d2a18adc2b4.png)

您的论坛是公开的吗？可以在此分享一个链接吗？

---

<div class="post-metadata">

**Author:** ![inherithandle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/inherithandle/32/230816_2.png) [@inherithandle](https://meta.discourse.org/u/inherithandle)\
**Post date:** [2021年八月15日 08:09 UTC](https://meta.discourse.org/t/how-to-align-an-alphabet-on-letter-avatar-profile-to-the-center/200272/3 "2021-08-15T08:09:02Z")

</div>

我原本以为通过调整论坛管理员设置就能解决这个问题，所以想问问大家能否提供一些帮助。结果发现是 ImageMagick 命令行的问题。我通过编写 Dockerfile 构建并运行了论坛的容器化版本。当我尝试运行 ImageMagick 命令时，生成的头像中字母位置略微偏右。因此，我打算更换一个 ImageMagick 版本。感谢大家的帮助！
