css - html italic letters protrude from their container (and may be cut by the next container' background) -


To clarify the problem (for the presentation purposes in the background, an alpha is 0.2):

  & lt; Duration style = "font-family: effect; font-size: 500pt; font-style: italic;" & Gt; & Lt; Span style = "border: 1px dotted # 000; background color: RGBA (10, 10, 10, 0.2);" Gt; & Lt; Span style = "border: 1px solid red; color: red; background color: rgba (200, 0, 0, 0.2);" & gt; World & lt; / Span & gt; & Amp; Nbsp; & Amp; Nbsp; & Lt; / Span & gt; & Lt; Duration style = "border: 1px dotted green; background color: rgba (200, 0, 0, 0.2);" gt; & Lt; Span style = "border: 1 px solid blue; color: blue; background color: rgba (0,0,200,0.2);" & gt; World & lt; / Span & gt; & Amp; Nbsp; & Amp; Nbsp; & Lt; / Span & gt; & Lt; / Span & gt;   

Lack of breaks are deliberate: HTML code is back-end-generated and font-styles may vary. Unfortunately I can not post pictures yet if you " Removes - in the example symbols, you will see that the last letter of the first word will be partly cut in the background of the next container.

I found this issue (well to some degree):

It is normal that some letters (such as' J ',' F ',' Especially in their italic form) emerge from their container box (if no padding exists.)

But why is this so? As far as I understand it - this is an html standard, but I can not find the exact document nor can I find the reason behind this behavior ...

Can anyone please tell me that Why is this behavior normal? And is there a good solution to the "background cut sheet" problem? Coz every WYSIWYG I've seen are impressed even more, but I can not think anyone complains (well, maybe I just suck on the search query, who knows)

The document has been correctly described that letters can extend the boundaries of their container box , Especially in Italic typeface It is a matter of typography, so it has not been specified in HTML or CSS specifications, although some CSS content may refer to it. The container box is just a typographical playground, and it can decide to cross the boundaries over time. The height of the container box is the size of the font, its width is the width of the glyph, and these amounts are used by programs when they insert text; They do not restrict glyphs.

This is even more so when fake italic (synthetic italic, algorithmic slated text) is used, and this happens when you use impact and ask for italic. There is no italic typeface for it, i.e. italic forms of glyphs prepared by a typographer, so a browser should ignore your request or produce fake italic. Since the size of the letters does not change through the skew, since the angle of tilt is quite large, it should be made to make "italic" different from the normal and the inclination amount is crossed to the right border of the container box. Makes more possible.

In classic typography, such issues can be addressed by adding some vacancies when needed. It is difficult to turn on automatic and therefore these days mostly did not. In CSS, you can use padding-right , but you need to wrap a word or a letter naturally in an element (usually span ) so that You have to apply for styling, like

  & lt; Span style = "padding-right: 0.08em" & gt; World & lt; / Span & gt;   

or

  & lt; I style = "padding-right: 0.08em" & gt; World & lt; / I & gt;   

This is cumbersome, especially, because the amount of interval is dependent on the last letter (and on the font and maybe on the first letter of the next word) Alternatively, you decide -Clear spaces, such as and Thinsp; , which corresponds to the method used in Lead Typography (a narrow piece of metal was placed after letters), but this is not flexible and dependable (the width of those letters) Actually according to the font different)

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -