80250

How to get “crispEdges” for SVG text?

Question:

Svg shapes other than text are affected by the shape-rendering attribute which can be set to the crispEdges value (<a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering</a>). This value seems to turn anti-aliasing off.

But text is only affected by text-rendering. However, this does not provide the crispEdges value (<a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-rendering" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-rendering</a>). Why? Is there another way to get non-anti-alias?

Answer1:

For really crisp edges, you can use a filter to posterize your text.

<pre class="snippet-code-html lang-html prettyprint-override"><svg width="400px" height="400px"> <defs> <filter id="crispify"> <feComponentTransfer> <feFuncA type="discrete" tableValues="0 1"/> </feComponentTransfer> </filter> </defs> <text filter="url(#crispify)" font-size="60" y="60" >Some crispy text</text> </svg>

Recommend

  • python 深度学习资料
  • Centos+Apache+passenger+rails: running rails apps from your www folder
  • PMA 4.5.2.0 file_exists(): open_basedir restriction in effect
  • typeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type &#
  • Receiving a SystemFault when I query Item
  • Printing just an iFrame
  • Building docker on yocto
  • Does Firebase provide us all queries like Parse Database for Android?
  • Fatal error: Call to a member function user() on boolean
  • How to do a partial merge in git?
  • How to set image in custom rounded corner image view in android
  • Java threads, green or native?
  • gmail does not render html in email
  • Streaming huge json with Akka Stream
  • Multiple JSliders reacting to each other to always equal 100 percent
  • MSBuild does not build solution file because of mismatching package name
  • What is need of Assign/Deassign in Verilog?
  • Angular 6 illegal operation on a directory, open '/Users//.npm-global/lib/node_modules/
  • CABasicAnimation creates empty default value copy of CALayer
  • Spring Cloud Config - Multiple Composite Repositories?
  • Hyperlink to Outlook Attachment
  • Get max bookings count in range
  • Spongycastle is missing many algorithms when loaded on android
  • How to run Daphne Server (Django Channels) & workers in the background?
  • Corda: How to implement hierarchical relationships between state data persisted to H2
  • Draw 9 patch dotted /dashed line on Android
  • Disabling swipe gesture in Windows Phone 8.1 pivot control
  • Auto send email based on the time and email address in database
  • Pandas time series data Index from a string to float [duplicate]
  • Why do you need 2 Javascript files for cross-platform Cordova plugin?
  • Facebook Error (#200) The user hasn't authorized the application to perform this action (PHP)
  • How to resolve this in PHPUnit where it is asking me to set KERNEL_DIR in my phpunit.xml?
  • select an input by value?
  • Ember.js + JQuery-UI Tooltip - Tooltip does not reflect the model / controller changes
  • trigger ontouch event programmatically
  • How to merge objects within array based on attribute
  • using maven pom while creating jar:test-jar some times it says JAR will be empty - no content was ma
  • Can a PHP script be scheduled to run at a specific time or after a specific amount of time has expir
  • Running R's aov() mixed effects model from Python using rpy2