imagettftext
imagettftext
. To perform this manipulation on the client side, the script described in this note is useful..js
extension to the page;typeface-js
class to the page element that needs to be displayed in a bizarre font;font-family: Some Font;
(the name of your font. Here you should be attentive and take the name from the font viewer or, say, from Photoshop).That's all. It is also worth noting that the font converter can be downloaded as a separate PERL module for local use.<html> <head> <! - First, load the external style file -> <link rel = "stylesheet" type = "text / css" ref = "/ style.css"> <! - Then typeface.js library and font file -> <script type = "text / javascript" src = "typeface-0.10.js"> </ script> <script type = "text / javascript" src = "some_font_regular.typeface.js"> </ script> </ head> <body> <! - Further - strictly to the north about 50 meters -> <div class = "typeface-js" style = "font-family: Some Font"> I am the text! And I am written in Some Font. </ div> </ body> </ html>
typeface-js
class you can write:At the output we will get the inscription in bold type Some Font of the 36th size and red. More information about the properties of CSS supported by the script can be found on the developer's site ..typeface-js { font: bold 36px Some Font; color: red; }
@font-face
, the addition of currently disabled CSS properties (in particular, x-height
and the subclass :hover
), etc.Source: https://habr.com/ru/post/43370/
All Articles