I hope none of you recognize me from my last bug report, I have a history of noticing stupid details…
I just noticed that letters are getting cut off to the leftmost in posts. At first I thought I was going crazy, but upon closer inspection it turned out I was somewhat sane.
Have a look at these two letters:
A A
Notice that the left leg of the first A is not quite as thick at the bottom as the left leg of the second? I won’t blame you if you don’t. Here’s a closeup (images captured on the forum of which I am a member):
Good catch, it’s incredibly slight. Looks as though the overflow: hidden; on .cooked is what’s causing it to be cut off, but I’m not entirely sure why the text would be overflowing by 1px to begin with… will investigate.
Small update on this, I tested it out a little bit more (in Chrome on Windows 10) and it’s definitely an issue that’s more pronounced on Windows specifically… and if you change the width of your browser window sometimes it happens, sometimes it doesn’t. I don’t really see it on my screen in OSX.
Seems like that would have something to do with subpixel rendering… I think the only way to solve that would be to add a small amount of padding to the left side of .cooked or remove the overflow: hidden (it’s there to protect content like images in deeply nested lists from overflowing the post container, but we might be able to apply it only to the nested containers?)
This issue is a little different. When a font is italicized, it overflows outside of its reserved space (and also its parent div) - so it’s getting cut off by our same overflow: hidden rule.
스크롤되지 않은 상태의 페이지 제목은 간단한 수정으로 해결할 수 있었습니다. 해당 제목은 여러 줄로 줄바꿈될 수 있으므로, overflow 속성은 긴 단어가 줄바꿈되지 않아 폭을 깨뜨리는 것을 방지하는 용도로만 사용되었습니다. overflow를 제거하고 overflow-wrap: break-word;를 추가하면 공간이 부족할 때 단어를 잘라줄 수 있습니다.
스크롤 시 제목이 헤더에 도킹되면 한 줄보다 긴 제목을 잘라내기 위해 overflow: hidden과 text-overflow: ellipsis를 함께 사용합니다… 여기서 overflow를 쉽게 제거할 수 없으므로, 일부 패딩을 추가하고 음수 마진으로 왼쪽 정렬을 다시 적용했습니다. 가장 아름다운 CSS는 아니지만, 동작은 합니다.
이것이 발생하는 _이유_에 대해 조금 더 자세히 설명하겠습니다. 폰트 안에는 em-box(또는 em-square라고도 함)라는 개념이 있습니다. 이 박스는 각 문자마다 동일한 크기를 가지며, 크기 조절, line-height 조정, letter-spacing 등에 사용되는 기준이 됩니다.
문자는 em-box 밖으로 모든 방향으로 확장될 수 있습니다… 어떤 문자에는 이것이 필수적인 경우도 있고, 단순히 폰트 디자이너가 그렇게 하기를 원한 경우도 있습니다. 브라우저에서는 이러한 overflow된 콘텐츠의 존재를 알 수 있는 방법이 없으므로, 이를 동적으로 고려할 수 있는 조치가 없습니다.
제 지식 범위 내에서 가능한 유일한 옵션은 가능한 한 텍스트의 overflow를 피하거나, 피할 수 없는 경우 약간의 추가 패딩을 추가하는 것입니다.