Cov txheej txheem:

Kuv yuav ua li cas ntxiv Google fonts kom hnov mob?
Kuv yuav ua li cas ntxiv Google fonts kom hnov mob?

Video: Kuv yuav ua li cas ntxiv Google fonts kom hnov mob?

Video: Kuv yuav ua li cas ntxiv Google fonts kom hnov mob?
Video: yuav coj li cas kom luag nyiam 2024, Kaum ib hlis
Anonim

suav nrog Google Fonts

Peb Teb . js app siv ib cov ntaub ntawv HTML. Mus tom ntej thiab kho cov pej xeem/index. html thiab ntxiv cov kab hauv qab no hauv ntu ntawm HTML kom suav nrog ob hom ntawv.

Tsis tas li ntawd, kuv yuav ua li cas ntxiv fonts kom hnov mob?

Download tau font los ntawm Google rau koj lub computer thiab qhib cov ntaub ntawv zip nws yog rub tawm hauv. Tsim ib ' fonts ' nplaub tshev hauv paus lossis src directory ntawm tsim- teb -app project. Luam the fonts koj xav siv (piv txwv li FiraSans. ttf) rau hauv ' fonts 'cov directory.

Tsis tas li ntawd, puas yog Google fonts pub dawb rau kev lag luam? Yog lawm, Google fonts tag nrho cov ntawv tso cai rau siv coj mus muag nyob rau hauv SIL Open Font Daim ntawv tso cai, uas tso cai rau leej twg siv lawv -- rau tus kheej THIAB kev lag luam tej yaam num -- dawb thiab meej.

Hais txog qhov no, yuav ua li cas kuv yuav import ib font rau react JS?

Hauv koj Teb project, tsim ib daim nplaub tshev hauv koj daim nplaub tshev src thiab npe nws ' fonts '. Hauv daim nplaub tshev no tsim cov ntaub ntawv uas koj hu fonts . js - qhov no yuav muaj cov imports rau koj fonts thiab tom qab ntawd yuav ua rau lawv muaj rau tus so ntawm koj lub app.

Kuv yuav txuas cov fonts rub tawm rau HTML li cas?

Txoj cai @font-face CSS tau piav qhia hauv qab no yog txoj hauv kev zoo tshaj plaws rau kev ntxiv cov ntawv sau rau hauv lub vev xaib

  1. Kauj ruam 1: Download tau lub font.
  2. Kauj Ruam 2: Tsim Cov Khoom Siv WebFont rau kev tshawb nrhiav.
  3. Kauj ruam 3: Upload cov ntaub ntawv font rau koj lub vev xaib.
  4. Kauj ruam 4: Hloov kho thiab upload koj cov ntaub ntawv CSS.
  5. Kauj ruam 5: Siv cov font kev cai hauv koj cov lus tshaj tawm CSS.

Pom zoo: