LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-17-2024, 11:50 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,612

Rep: Reputation: 180Reputation: 180
css @font-face not working


I've been using a @font-face style for years without problem. Now it suddenly doesn't work. Dunno why. Possibly some upgrade to something. A simplified page is:
Code:
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: MICRW2;
src: local("/tmp/trash/micr-W2.ttf");               
}
</style>
</head>
<body>  

<div style="font-family: MICRW2; font-size: 10pt">
<000010198< :044002174:640240500000011797<
</div>

</body>
</html>
This simply displays the literal "<000010198< :044002174:640240500000011797<" on the page, no MICR font. This html is in the directory /tmp/trash and I've also tried various combinations of:
Code:
src: url("/tmp/trash/micr-W2.ttf");
src: url("micr-W2.ttf");
src: url("http://www.novatec-inc.com/pub/micr-W2.ttf");
Nothing works. I've tried with FireFox, Edge and Chrome.

What am I missing?
 
Old 05-20-2024, 01:29 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
This one worked for me:
Code:
<style>
@font-face {
  font-family: MICRW2;
  src: url("file://localhost/C|/temp/micr-W2.ttf");
}
On the other hand, neither of these made it possible to use font via remote-url:
Code:
  <meta http-equiv="Access-Control-Allow-Origin" content="*">
  <meta http-equiv="Content-Security-Policy" content="*">
Maybe because it is a static file. Or because it is http not https.

(Note: CORS (Origins, Options, preflight requests, Security-Policy, HSTS etc) is way above my understanding, but surely it is good for something.)

Last edited by NevemTeve; 05-20-2024 at 03:46 AM.
 
Old 05-22-2024, 05:37 PM   #3
Fearless Fred
Member
 
Registered: Jan 2022
Location: UK
Distribution: Mabox - Manjaro/Arch
Posts: 60

Rep: Reputation: 37
because of your less than symbol, "<000010198< :044002174:640240500000011797<" is being rendered literally as its an 'unclosed opening tag'

Try using the html entity for the less than symbol, &lt; instead of the unclosed 'opening brackets' as the html parser is seeing it on the page;


&lt;000010198&lt; :044002174:640240500000011797&lt;
 
  


Reply

Tags
css, font-face



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
css font-face not working mfoley Linux - General 0 05-16-2024 09:44 PM
OpenSUSE-Georgia (USA) face to face meeting details XenaneX SUSE / openSUSE 0 12-03-2009 07:09 AM
LXer: FFII face-to-face to solve patent problems LXer Syndicated Linux News 0 11-17-2006 03:54 AM
face to face, man to man dazzler Linux - General 1 07-27-2004 06:27 AM
face to face in Malaysia ... Penang thomassounness Linux - Newbie 3 06-29-2003 06:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration