~~NOTOC~~ ====== Signed Distance Field MeshStyle ====== ---- dataentry extension ---- author_mail : maligan@rambler.ru Alexandr description : Allows draw signed distance fields compatible : v2.0 # the Starling version you tested the extension with tags : style, textfield homepage_url : https://gist.github.com/Maligan/179d9211aede3c013f83e42f8d3d2718 ---- ===== WARNING ==== Now starling support this feature from the box, please read manual\\ [[manual:distance_field_fonts|Distance Field Fonts]]. ===== Demo ===== {{ :extensions:sdf-demo.mp4?747x175 |}} ===== Overview ===== Signed distance field rendering is a technique that allows render bitmap fonts with crispy result while upscaling. If you have not heard anything about this before, please, read this [[https://github.com/libgdx/libgdx/wiki/Distance-field-fonts|libgdx article]].\\ For creating distance field font you can use [[http://kvazars.com/littera/|littera]].\\ For usage this amazing trick simply change ''style'' property on your TextField or Mesh: textField.style = new SignedDistanceFieldStyle(4.0); Constructor takes one argument - ''spread'' this value depends on distance field bitmap creating and define edge sharpness, just change it if you want to make edges less or more smooth. Style tracks only DisplayObject scale and do not tracks TextField front size, you need multiply spread by ratio base font size and current font size. ===== Changelog ===== * //2016/07/09 18:54//: First public version ===== User Comments ===== //Feel free to edit this part of the page if you want to add information that's lacking in the above description.\\ Questions are better asked in the [[http://forum.starling-framework.org|forum]], though.//