- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有一个 SVG 来显示带有文本的洗衣机图标。文本是以绿色六边形显示的数字。
不幸的是,Google Chrome 无法显示文本,而我测试的所有其他浏览器(Firefox 和 Microsoft Edge)都可以。
此代码段中的字体不可用,但对相关问题没有影响。
svg.machine {
height: 300px;
max-width: 100%;
shape-rendering: geometricPrecision;
text-rendering: geometricPrecision;
image-rendering: auto;
fill-rule: evenodd;
clip-rule: evenodd; }
svg.machine .machine {
display: block; }
svg.machine .machine .label {
fill: #727272;
font-family: 'Open Sans Condensed', sans-serif;
font-weight: 300;
font-size: 75000px;
text-align: center;
text-anchor: middle;
letter-spacing: -1px; }
svg.machine .machine .mask {
fill: white; }
svg.machine .machine .draw {
fill: #727272; }
svg.machine .timer-up {
display: none; }
svg.machine .timer-up .bg {
fill: #CD2628; }
svg.machine .timer-up .icon {
fill: white; }
svg.machine .timer-up .timer {
fill: #CD2628;
font-family: 'Open Sans Condensed', sans-serif;
font-weight: 300;
font-size: 60000px;
text-align: left;
text-anchor: start;
line-height: 1em;
letter-spacing: -1px; }
svg.machine .number polygon {
fill: #00a627;
stroke: #fff;
stroke-width: 4000;
stroke-linejoin: round; }
svg.machine .number text {
fill: white;
font-weight: bold;
font-weight: 700;
font-size: 110000px;
font-family: 'Open Sans', sans-serif;
text-align: center;
text-anchor: start; }
<svg class="machine" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500000 800000">
<defs><linearGradient id="shadowgrad" x1="0" y1="0" x2="0" y2="1"><stop offset="0" style="stop-opacity:0; stop-color:black"></stop><stop offset="1" style="stop-opacity:0.35; stop-color:black"></stop></linearGradient></defs>
<g class="machine">
<text class="label" x="250000" y="780000">Washing</text>
<polygon class="shadow" fill="url(#shadowgrad)" points="381195,596338 500001,596338 447930,686527 381095,686794"></polygon>
<polygon class="mask" points="444699,190671 444699,679480 435706,688473 65209,688473 55713,678978 55713,190671 106773,157128 393640,157128"></polygon>
<polygon class="mask" points="444699,190671 444699,679480 435706,688473 65209,688473 55713,678978 55713,190671 106773,157128 393640,157128"></polygon>
<path class="draw" d="M396677 397755c7052,1566 12381,7889 12381,15409l0 92369c0,7511 -5325,13845 -12381,15412 -24072,57251 -80678,97460 -146676,97460 -87839,0 -159055,-71216 -159055,-159055 0,-87839 71216,-159055 159055,-159055 65998,0 122603,40208 146676,97460zm-146676 -59167c44008,0 82515,23546 103622,58723l33090 0c-7247,-15981 -17433,-30956 -30575,-44098 -58617,-58617 -153657,-58617 -212273,0 -58617,58617 -58617,153656 0,212273 58616,58618 153656,58618 212273,0 13142,-13142 23331,-28116 30577,-44099l-33091 0c-21107,35177 -59614,58725 -103623,58725 -66693,0 -120762,-54069 -120762,-120762 0,-66694 54069,-120762 120762,-120762zm90193 178578c-3278,-3008 -5132,-7123 -5132,-11633l0 -29264c-9208,-6274 -15254,-16842 -15254,-28823 0,19249 -15605,34854 -34856,34854 -19253,0 -34858,-15605 -34858,-34854 0,19249 -15603,34854 -34856,34854 -19251,0 -34856,-15605 -34856,-34854 0,19802 -16430,35561 -36197,34826 11988,47327 54860,82346 105911,82346 37398,0 70404,-18795 90098,-47452zm53082 -110823l-42361 0c-3756,0 -6821,3065 -6821,6821l0 92369c0,3753 3066,6823 6821,6823l42361 0c3755,0 6821,-3070 6821,-6823l0 -92369c0,-3756 -3063,-6821 -6821,-6821zm-323031 -219067l359560 0 -37918 -22749 -283725 0 -37917 22749zm228015 28999l79315 0c2935,0 5336,2401 5336,5337l0 15254c0,2936 -2401,5339 -5336,5339l-79315 0 0 -25930zm-88591 0l80713 0 0 25930 -80713 0 0 -25930zm-87191 0l79313 0 0 25930 -79313 0c-2937,0 -5338,-2403 -5338,-5339l0 -15254c0,-2936 2401,-5337 5338,-5337zm313869 50997l-372644 0 0 412986 372644 0 0 -412986zm-372644 -3942l372644 0 0 -68204 -372644 0 0 68204zm388346 416928c2,8666 -7034,15703 -15702,15703l-372644 0c-8669,0 -15703,-7031 -15703,-15703l0 -489057c0,-6175 3565,-11516 8749,-14081l43378 -26026c2522,-1508 5296,-2225 8035,-2221l283725 -49c3407,0 6561,1086 9134,2929l43361 26015c4897,2929 7614,8113 7619,13433l48 489057z"></path>
</g><!--/.machine -->
<g class="timer-up">
<text class="timer" x="231016" y="88483">
</text>
<path class="bg" d="M168993 15147c27674,0 50108,22433 50108,50107 0,27277 -21797,49463 -48926,50092l0 39564 -2362 0 0 -39564c-27129,-626 -48928,-22813 -48928,-50092 0,-27674 22434,-50107 50108,-50107z"></path>
<path class="icon" d="M168993 65254l35479 -12591c1434,4043 2167,8301 2167,12591 0,20791 -16854,37646 -37646,37646 -20791,0 -37646,-16855 -37646,-37646 0,-20791 16855,-37647 37646,-37647l0 37647z"></path>
</g><!--/.timer-up -->
<g class="number">
<polygon points="105670,539360 146770,563080 187850,586810 187850,634250 187850,681700 146770,705420 105670,729140 64590,705420 23500,681700 23500,634250 23500,586810 64590,563080"></polygon>
<g transform="matrix(1.01342 0 0 1 -92445.3 253722)">
<text x="164000" y="415990">1</text>
</g>
</g><!--/.number -->
</svg>
是什么导致了这种差异?
编辑:减小 View Box 的大小并不能改善这种情况。仅谷歌浏览器还是无法显示<text>
其他浏览器(甚至 IE)可以的元素。
最佳答案
不同之处在于 Chrome 浏览器的 font-size
限制。 Chrome 的最大 font-size
限制为 10000px。
关于html - 为什么谷歌浏览器无法在 SVG 中正确显示文本标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50907074/
这个问题已经有答案了: How to do case insensitive string comparison? (23 个回答) 已关闭 3 年前。 用户在我的输入栏中写入“足球”,然后执行第 6
啊,不习惯 javascript 中的字符串。 character_id= + id + correct= + correctOrIncorrect 这就是我需要制作成字符串的内容。如果您无法猜测字符
$(function() { var base_price = 0; CalculatePrice(); $(".math1").on('change', function(e) { Calc
我找不到任何文章回答问题:将Spinnaker部署到Spinnaker将管理的同一Kubernetes集群是否安全/正确?我主要是指生产,HA部署。 最佳答案 我认为Spinnaker和Kuberne
我正在使用MSVC在Windows上从源代码(官方源代码发布,而不是从仓库中)构建Qt5(Qt 5.15.0)。 我正在设置环境。变量,依赖项等,然后运行具有1600万个选项的configure,最后
我需要打印一个包含重复单词的数组。我的数组已经可以工作,但我不知道如何正确计算单词数。我已经知道,当我的索引计数器 (i) 为 49 时,并且当 (i) 想要计数到 50 时,我会收到错误,但我不知道
我正在遵循一个指南,该指南允许 Google map 屏幕根据屏幕尺寸禁用滚动。我唯一挣扎的部分是编写一个代码,当我手动调整屏幕大小时动态更改 True/False 值。 这是我按照说明操作的网站,但
我有一个类“FileButton”。它的目的是将文件链接到 JButton,FileButton 继承自 JButton。子类继承自此以使用链接到按钮的文件做有用的事情。 JingleCardButt
我的 friend 数组只返回一个数字而不是所有数字。 ($myfriends = 3) 应该是…… ($myfriends = 3 5 7 8 9 12). 如果我让它进入 while 循环……整个
这个问题在这里已经有了答案: Is there a workaround to make CSS classes with names that start with numbers valid?
我正在制作一个 JavaScript 函数,当调整窗口大小时,它会自动将 div 的大小调整为与窗口相同的宽度/高度。 该功能非常基本,但我注意到在调整窗口大小时出现明显的“绘制”滞后。在 JS fi
此问题的基本视觉效果可在 http://sevenx.de/demo/bootstrap-carousel/inc.carousel/tabbed-slider.html 获得。 - 如果你想看一看。
我明白,如果我想从函数返回一个字符串文字或一个数组,我应该将其声明为静态的,这样当被调用的函数被返回时,内容就不会“消亡”。 但我的问题是,当我在函数内部使用 malloc 分配内存时会怎样? 在下面
在 mySQL 数据库中存储 true/false/1/0 值最合适(读取数据消耗最少)的数据字段是什么? 我以前使用过一个字符长的 tinyint,但我不确定它是否是最佳解决方案? 谢谢! 最佳答案
我想一次读取并处理CSV文件第一行中的条目(例如打印)。我假设使用Unix风格的\n换行符,没有条目长度超过255个字符,并且(现在)在EOF之前有一个换行符。这意味着它是fgets()后跟strto
所以,我们都知道 -1 > 2u == true 的 C/C++ 有符号/无符号比较规则,并且我有一种情况,我想有效地实现“正确”比较。 我的问题是,考虑到人们熟悉的尽可能多的架构,哪种方法更有效。显
**摘要:**文章的标题看似自相矛盾。 本文分享自华为云社区《Java异常处理:如何写出“正确”但被编译器认为有语法错误的程序》,作者: Jerry Wang 。 文章的标题看似自相矛盾,然而我在“正
我有一个数据框,看起来像: dataDemo % mutate_each(funs(ifelse(. == '.', REF, as.character(.))), -POS) # POS REF
有人可以帮助我使用 VBScript 重新格式化/正确格式化带分隔符的文本文件吗? 我有一个文本文件 ^分界如下: AGREE^NAME^ADD1^ADD2^ADD3^ADD4^PCODE^BAL^A
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我是一名优秀的程序员,十分优秀!