Open Bug 1342944 Opened 7 years ago Updated 1 year ago

Upload SVG emoticons to the codebase

Categories

(Other Applications :: ChatZilla, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: hunboy, Assigned: hunboy)

References

(Blocks 3 open bugs)

Details

Attachments

(1 file, 1 obsolete file)

For future usage on retinapixel screens we need vector-based graphics instead of the png we have currently. These smileys are equal to the png's by 16x16 px size
Attached patch the smileys (obsolete) — Splinter Review
Assignee: rginda → utasir
Status: NEW → ASSIGNED
Attachment #8841585 - Flags: review?(bugzilla-mozilla-20000923)
xml:space="preserve" is only useful/functional if the SVG contains text.

Why do many svg files apply an offset of 0 e.g.

<feOffset result="offOut" in="SourceAlpha" dx="0" dy="0" />

That a no-op
Blocks: 1344452
Blocks: 325303
(In reply to Robert Longson from comment #2)
> xml:space="preserve" is only useful/functional if the SVG contains text.
> 
> Why do many svg files apply an offset of 0 e.g.
> 
> <feOffset result="offOut" in="SourceAlpha" dx="0" dy="0" />
> 
> That a no-op

These files were originally generated by AI, and were simplified.
The #ff3 filter is for the gray alphachanell as "shadow" around the emoticon.
> <feOffset result="offOut" in="SourceAlpha" dx="0" dy="0" />
> 
> That a no-op

Robert, if I remove that, the "shadow" circle disappears...

https://jsfiddle.net/jtwm8jdh/

What do you mean on "no-op" ? That is necessary.
Flags: needinfo?(longsonr)
This gives the same result as your fiddle. Note that the edge are cut off in your fiddle and in the markup below. I'm not sure why you're specifying an x and y of 0 but if you decreased those (and increased the width if necessary) you could fix that.

  <filter id="ff3" x="0" y="0" width="110%" height="110%">
    <feGaussianBlur result="blurOut" in="SourceAlpha" stdDeviation="0.25" />
    <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
  </filter>
Flags: needinfo?(longsonr)
Attached patch the smileysSplinter Review
Reduced the svg code based on suggestions
Attachment #8841585 - Attachment is obsolete: true
Attachment #8841585 - Flags: review?(bugzilla-mozilla-20000923)
Attachment #8843636 - Flags: review?(bugzilla-mozilla-20000923)
Robert, just 1 more question I can't solve:

How we force resize the emoticon if that is in a pseudo-element's content?

Here is simple sample I prepared:

https://jsfiddle.net/g02fc64o/

So the plan: auto-resizing the content-image also when we change the font-size on the messages.
Pls, use the range meter, to see how it doesn't happen.

Question: is there a way by svg to keep (and apply) the defined size (now forced 1em) for the content: loaded svg?

I hope you understand my question, however I can't explain better :)

p.s. for some reasons we use the ::after {content: url(...)} for the smilies, because it is motif dependent and user can enable/disable the smilies on the messages, so I know pretty well if it works well on foreground <img> element, but we can't use that.


Here is the current base64 :

<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" height="16px" width="16px">
<g>
  <circle fill="#000000" cx="8.20" cy="8.20" r="7.4" opacity="0.6" filter="url(#ff3)" />
  <circle fill="#FFCC00" cx="7.5" cy="7.5" r="7.5"/>
  <circle fill="url(#cZgrad)" cx="7.5" cy="7.5" r="6.5"/>
  <circle fill="#333366" cx="5" cy="5" r="1"/>
  <circle fill="#333366" cx="10.1" cy="5" r="1"/>
  <path fill="none" stroke="#333366" stroke-width="1.504" stroke-linecap="round" stroke-miterlimit="10" d="M3.8,8.6 c0,0,0.6,2.8,3.8,2.8s3.9-2.8,3.9-2.8"/>
</g>
<defs>
  <radialGradient id="cZgrad" cx="-70.821" cy="85.1078" r="0.5" gradientTransform="matrix(13.0699 0 0 -13 930 1110.13)" gradientUnits="userSpaceOnUse">
  	<stop  offset="0" stop-color="#FFFFFF"/>
  	<stop  offset="0.1621" stop-color="#FFFEFB"/>
  	<stop  offset="0.3338" stop-color="#FFFCEE"/>
  	<stop  offset="0.51" stop-color="#FFF7D9"/>
  	<stop  offset="0.6893" stop-color="#FFF1BB"/>
  	<stop  offset="0.8692" stop-color="#FFEA95"/>
  	<stop  offset="1" stop-color="#FFE375"/>
  </radialGradient>
  <filter id="ff3" x="-5%" y="-5%" width="110%" height="110%">
    <feGaussianBlur result="blurOut" in="SourceAlpha" stdDeviation="0.25" />
    <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />
  </filter>
</defs>
</svg>
Flags: needinfo?(longsonr)
I'm not sure why it's not scaling.
Flags: needinfo?(longsonr)
Robert, when I set preserveAspectRatio="none" and remove the height and width, and define as background-image, it does what I want.

https://jsfiddle.net/g02fc64o/1/

Any nits on it? Does it cause any trouleshoots? I mean by using preserverAspectRatio, i didnot need to set up background-size: cover . is it stable?
Flags: needinfo?(longsonr)
It shouldn't make a difference whether you preserve the aspect ratio or not as your viewBox aspect ratio is 1:1 as is your width/height.
Flags: needinfo?(longsonr)
Comment on attachment 8843636 [details] [diff] [review]
the smileys

Review of attachment 8843636 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM r=silver
Attachment #8843636 - Flags: review?(bugzilla-mozilla-20000923) → review+
Blocks: 1362768
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: