Basic

Local assignment of google font - Basic

Local assignment of google font

by boardheini » Sun Dec 18, 2022 11:25 am

Hello,

i would like to use a Google font with this style. Several other styles perfectly use the locally stored font, only the basic style refuses to use it.

i stored the font under /assets/fonts and added the following css code to the "_style_config.scss" in the visual studio code:

Code: Select all

/* niconne-regular - latin */
@font-face {
	font-family: 'Niconne';
	font-style: normal;
	font-weight: 400;
	src: url('/assets/fonts/niconne-v15-latin-regular.eot'); /* IE9 Compat Modes */
	src: local(''),
		 url('/assets/fonts/niconne-v15-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
		 url('/assets/fonts/niconne-v15-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
		 url('/assets/fonts/niconne-v15-latin-regular.woff') format('woff'), /* Modern Browsers */
		 url('/assets/fonts/niconne-v15-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
		 url('/assets/fonts/niconne-v15-latin-regular.svg#Niconne') format('svg'); /* Legacy iOS */
  }
This compiles to the following in the "stylesheet.css":

Code: Select all

@font-face {
  font-family: "Niconne";
  font-style: normal;
  font-weight: 400;
  src: url("/assets/fonts/niconne-v15-latin-regular.eot"); /* IE9 Compat Modes */
  src: local(""), url("/assets/fonts/niconne-v15-latin-regular.eot?#iefix") format("embedded-opentype"), url("/assets/fonts/niconne-v15-latin-regular.woff2") format("woff2"), url("/assets/fonts/niconne-v15-latin-regular.woff") format("woff"), url("/assets/fonts/niconne-v15-latin-regular.ttf") format("truetype"), url("/assets/fonts/niconne-v15-latin-regular.svg#Niconne") format("svg"); /* Legacy iOS */
}
However, unlike the other styles i use, it does not use this font in the browser, but replaces it.

Could somebody please give me a hint how to solve this? I guess it might be something very basic i am doing wrong, but i am not very familar with sass and css. Would be great to get some advice. Thanks
boardheini
Registered User
Posts: 1
Joined: Mon Apr 18, 2022 2:19 pm