hugo-theme-texify icon indicating copy to clipboard operation
hugo-theme-texify copied to clipboard

render issues

Open essisore opened this issue 3 years ago • 10 comments

Thanks for your pretty theme.

There is a render issue when use a different customer font in Safari and mobile. image

No problem in Chrome.

image

custom.css

@import url('https://cdn.jsdelivr.net/npm/[email protected]/style.css');

#wrapper {
    font-family: 'LXGW WenKai', "Times New Roman", serif
}

essisore avatar May 05 '22 11:05 essisore

No problem in Firefox here too. Am looking into the issue.

queensferryme avatar May 06 '22 12:05 queensferryme

Please update the theme and see if it is fixed.

queensferryme avatar May 06 '22 12:05 queensferryme

Thanks for your response, it works.

But there are two places are remaining not rendered properly, can you take a look?

image

The title should be rendered in one line.

image

Same problem.

essisore avatar May 07 '22 01:05 essisore

题外话:霞鹭文楷的粗体和常规体区分度不明显,有时候不仔细查看都无法发现某段文字有加粗。因此个人并不建议你使用这种字体。

queensferryme avatar May 07 '22 02:05 queensferryme

@justlongfei

TLDR: use font-family: 'LXGW WenKai' instead of font-family: 'LXGW WenKai', 'Times New Roman', serif.

Long explanation:

I believe this bug belongs to Safari or LXGW Wenkai. But I don't have the time to dig into the root cause right now. I can't fix this bug, but you can avoid the bug with font-family: 'LXGW WenKai' instead of font-family: 'LXGW WenKai', 'Times New Roman', serif (somehow, I don't know why). A minimal reproducible example:

<!DOCTYPE html>
<html lang="en">

<head>
    <style>
        @import url('https://cdn.jsdelivr.net/npm/[email protected]/style.css');

        #wrapper {
            display: flex;
            font-family: 'LXGW WenKai', serif;
        }
    </style>
</head>

<body>
    <div id="wrapper">
        <h1>
            <a href="/">Any Text with Word-Breaks</a>
        </h1>
        <h1>
            <a href="/">OK_When_No_Word_Breaks</a>
        </h1>
    </div>
</body>

</html>

Renders like this on Safari: 图片

queensferryme avatar May 07 '22 12:05 queensferryme

similar issue https://github.com/rsms/inter/issues/321

essisore avatar May 07 '22 15:05 essisore

image

essisore avatar May 07 '22 15:05 essisore

I don't know, maybe really hit WebKit's bug.

essisore avatar May 07 '22 15:05 essisore

Renders like this on Safari: 图片

It appears to be some bug introduced by the cdn stylesheet however I did not study this through. To fix, do something like following to the H1 tag, for instance apply flex:auto, to make them share the full width of flex container therefore reduce chances of getting word-wrapped. Its inner a tag natively has no width creates a log of problems among different browsers.

#wrapper {
            display: flex;
            font-family: 'LXGW WenKai', serif;
            background-color: blueviolet;
            /* justify-content: space-around; */  /* not needed if inner elements have flex-grow and basis */
            /* white-space: nowrap; */  /* result unnecessary overflow */
        }
        h1:first-of-type {
            background-color: lightblue;
        }
        h1:last-of-type {
            background-color: lightgreen;
        }
        h1 {
            flex: auto;
            text-align: center;
        }

benjaminv avatar May 08 '22 00:05 benjaminv

题外话:霞鹭文楷的粗体和常规体区分度不明显,有时候不仔细查看都无法发现某段文字有加粗。因此个人并不建议你使用这种字体。

感谢您的反馈,粗体本来是作为 Medium 字重,后因为有用户提议才将 Medium 改为 Bold 字重(lxgw/LxgwWenKai#37)。之后的版本会考虑调整,Bold 将改回 Medium,Light 将改为 SemiLight。 image

而在此基础上加粗调整的 臻楷 依然有很多人觉得细,或许有原字体比较细的原因,主要还是我在字重的选择上太保守了,直接机械加粗又怕糊掉。

lxgw avatar Jun 01 '22 23:06 lxgw