material-design-icons icon indicating copy to clipboard operation
material-design-icons copied to clipboard

Some icons have a weird width

Open Primajin opened this issue 10 years ago • 23 comments

insert_image vs image

Shouldn't they look the same?

implemented via link https://fonts.googleapis.com/icon?family=Material+Icons

Primajin avatar Feb 03 '16 15:02 Primajin

Yes, I noticed the same issue with the closed_captions icon.

feross avatar May 13 '16 00:05 feross

dito for star_rate

CNSKnight avatar Jun 06 '16 16:06 CNSKnight

Can confirm for star_rate too.

rstoenescu avatar Jun 10 '16 14:06 rstoenescu

Could it be that star_rate is designed so that you can string 5 of them next to each other to make a "number of stars" rating indicator? (Chris)

On Fri, Jun 10, 2016 at 7:48 AM, Razvan Stoenescu [email protected] wrote:

Can confirm for star_rate too.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/material-design-icons/issues/302#issuecomment-225202900, or mute the thread https://github.com/notifications/unsubscribe/AAtIJvTB8PIL9bTwydMcHDjZdGTZMaKPks5qKXk7gaJpZM4HSg6v .

TheChrisPratt avatar Jun 10 '16 16:06 TheChrisPratt

This occurs when the icon font doesn't contain the icon you're trying to use.

  • insert_image isn't in the font because we don't have an icon by that name. insert_photo is probably what you're looking for.
  • closed_captions isn't in the font, but closed_caption is. That extra s is what's adding the unwanted space.
  • star_rate doesn't exist in the icon font, although I agree that it should. I've opened #430 to remind me to add it.

shyndman avatar Jul 14 '16 15:07 shyndman

Capture

equal size :)

johancruyff2019 avatar Jan 15 '19 06:01 johancruyff2019

The icon calendar_today seems to be too large as well when you use it like this:

<i class="material-icons">
calendar_today
</i>

groovytron avatar Jan 23 '19 09:01 groovytron

The icon alt_list seems to be too large and has not border. alt_list_material_issue

Oneia avatar Feb 07 '19 11:02 Oneia

We have the problem for visibility_off, and we debug for 6+ hours on it. Any solution?

yrjsg avatar Mar 15 '19 06:03 yrjsg

Any update on this? Also running into this issue for calendar_today icon.

VictorGerritsen avatar Apr 10 '19 09:04 VictorGerritsen

calendar_today has a broken width, with no other changes image

wshaver avatar Apr 15 '19 16:04 wshaver

calendar_today is fixed in this fork, other items might be as well: https://github.com/jossef/material-design-icons-iconfont

wshaver avatar Apr 15 '19 16:04 wshaver

star_rate_size_different

star_rate is definitely behaving differently. Here is a clear screenshot of the problem.

CoreySchnedl avatar Apr 25 '19 03:04 CoreySchnedl

Share icon is not aligned center. Problems seems to be inside the element itself and not CSS. Finally fixed it by adding margin -2px individually to this one item. Somehow this icon seems to be bigger too than the other icons. colovr com-material-icons-share-align

TheSamp avatar Jun 27 '19 11:06 TheSamp

image

This is still occuring.

Zalkota avatar Aug 15 '19 01:08 Zalkota

The icon you're using is called star. Remove _rate and the spacing will be correct.

shyndman avatar Aug 15 '19 01:08 shyndman

Nevertheless of any namings etc. - shouldn't all icons have the same size? Like a monospaced font? That gives predictability and anyone can easily add paddings/margins as they wish. This behavior is clearly unexpected and thus considered a bug.

Primajin avatar Aug 15 '19 05:08 Primajin

It is monospace, actually. The problem here is that the ligature (the string you write to trigger the display of an icon) needs to be an exact match. Extra characters take up horizontal space.

For example, let's say your font size is 24px and you are using star. That icon renders at 24x24. Perfect.

But now lets say you make a mistake, and write star_rate instead. star matches, renders the star icon in place of that string, but we still have _rate hanging off the end. Although we don't actually render the _rate characters (the icon font has a set of blank latin alphabet characters), they're still there, and they still have a width.

Hope that helps.

shyndman avatar Aug 15 '19 05:08 shyndman

But I'll admit, it's not ideal. It's a weird way to fail.

One thing I've seen people do is to use numerical character references (NCR) instead of ligatures — they'll refer to an icon with &#xe84d; instead of 3d_rotation. It guards against this kind of error.

There's a codepoints file in the repo that can be used to generate a list of NCRs.

shyndman avatar Aug 15 '19 05:08 shyndman

Ahh that's why! Thanks for the explanation. Ideally this would also show up as the proposed usage on https://material.io/resources/icons/ so people are inclined to go with the entities. On the other hand I guess the whole UX Idea of the font was to use ligatures so people exactly don't have to do that... Tricky. Couldn't the font be set in a way that the other characters get represented with the zero width char that is also used for emojis?

Primajin avatar Aug 15 '19 06:08 Primajin