Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
João Silva
247
Views
5
Comments
Font-Web
Question
OutSystems Widgets
How can I integrate web fonts https://fortawesome.github.io/Font-Awesome example?
how to import files and font as the address is in CSS?
António Chinita
Hi Paulo.
What you need to do is add your font files as resources, set the Deploy to target directory option, type in a path (and remember it).
Like so:
https://screencast.com/t/OPwcTZdlV
Then add your @font-face css, pointing to the path and files, to your theme.
Eg.
@font-face {
font-family: 'myWebFont';
src: url('/fonts/myFont.eot');
src: url('fonts/myFont.eot?iefix') format('eot'),
url('fonts/myFont.woff') format('woff'),
url('fonts/myFont.ttf') format('truetype'),
url('fonts/myFont.svg#webfontpQgNQDw9') format('svg');
font-weight: normal;
font-style: normal;
}
Usage:
body, html {
font-family: "myWebFont", Arial, Helvetica, FreeSans, sans-serif, "open-serif", open-serif;
}
h1 {
font-family: "myWebFont", Arial, Helvetica, FreeSans, sans-serif, "open-serif", open-serif;
}
Gonçalo Martins
Staff
Nice post Chinita,
I think I already saw this before in a past project with you.. :)
Cheers,
GM
João Silva
just stayed with a doubts in following question look how was that became my CSS the unique way that worked.
@font-face {
font-family: 'FontAwesome';
src: url('./fonts/fontawesome-webfont.eot?v=4.0.1');
src: url('./fonts/fontawesome-webfont.eot?#iefix&v=4.0.1') format('embedded-opentype'), url('./fonts/fontawesome-webfont.woff?v=4.0.1') format('woff'), url('./fonts/fontawesome-webfont.ttf?v=4.0.1') format('truetype'), url('./fonts/fontawesome-webfont.svg?v=4.0.1#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
Unlike the example that has only one point in the directory
url('/fonts/fontawesome-webfont.eot?v=4.0.1');
Capturar.JPG
António Chinita
I gave you an example that loads multiple files, because some browsers don't support all of them.
Think of it as a fallback for browsers that might not support .eot, for example, but support .woff or .ttf.
:)
Best regards :)
Davide Marquês
Hi all,
You'll also have to configure the mime type for woff files on IIS (otherwise the files aren't served):
https://www.dirigodev.com/blog/404-errors-in-IIS7-for-embedded-woff-font-files/
Cheers,
Davide
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...