LCD font front end implementation (most detailed)

Realization of LCD fonts on the front end

According to the needs of the project, you need to achieve the effect shown in the figure (this is also the actual effect diagram), and make a method summary:
Insert picture description here
specific implementation steps:

1. First go to dafont to download the fonts you need. Many fonts it provides are more than LCD fonts.
Insert picture description here
Click 1: You can see that there are also many different styles under the LCD font
Insert picture description here
Click 2:Download, unzip
Insert picture description here
2. Open fontsquirrel as shown in the figure:
Insert picture description here
3. Select the custom configuration on the far right, in order to be compatible with as many browsers as possible, follow the selections below:
Insert picture description here
4.Click upload fonts at the top to uploadJust downloaded (What you needTTF file of the one),Click I agree under the slip and start downloading.
5. Unzip the compressed package to get the following files:
Insert picture description here
6. Put this folder (the entire folder) into the static resource storage location of the corresponding project, such as the assets/font folder.
7. Write the following code in the css of the page where you need this font:

/* 引入lcd字体 */
@font-face {
  font-family: "wgsFont";
  src: url("../font/ds-digi-webfont.eot"); /* IE9 Compat Modes */
  src: url("../font/ds-digi-webfont.eot?#iefix") format("embedded-opentype"), /*IE6-IE8 */
    url("../font/ds-digi-webfont.woff") format("woff"),  /* Modern Browsers */
    url("../font/ds-digi-webfont.ttf") format("truetype"),  /* Safari, Android, iOS */
    url("../font/ds-digi-webfont.svg") format("svg");   /* Legacy iOS */
}

At this point, the preparation work is completed
. How to use the code: (font-size, color, font-weight, etc. are all available normally, but one font has been added. Of course, you can name the font yourself in step 7. )
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43131046/article/details/114099006