Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Webfonts in themes missing in extended (derived) themes

  • ritapas
  • ritapas's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 7 months ago - 2 years 7 months ago #218708 by ritapas
Hello,
I've developed a theme which uses some custom webfonts.
I've uploaded the fonts in the theme resources box and added appropriate css in the custom.css file, like the following:
Code:
@font-face {
font-family: 'Open Sans';
src: url("../files/OpenSans-Regular-webfont.woff")format("woff"), url("../files/OpenSans-Regular-webfont.ttf") format("truetype");
font-weight:400;
font-style: normal;
}

This works in that particular theme, but if I extend it, while using the derived theme I got the following errors in the browser console:
Code:
downloadable font: download failed (font-family: "Open Sans" style:normal weight:400 stretch:100 src index:0): status=2147746065 source: https://xxx.xxx.xxx.xxx/limesurvey/tmp/assets/e56e81b5/files/OpenSans-Regular-webfont.woff


Can you help?
I wouldnt' like to reload the files for each derived theme.
LS Version: 3.23.5

Best regards.
Rita
Last edit: 2 years 7 months ago by ritapas. Reason: fix
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #218711 by tpartner
Try an absolute path to the font file.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: ritapas
The topic has been locked.
  • ritapas
  • ritapas's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 7 months ago #218712 by ritapas
Hello, this is odd, since you don't need to do this when using other resources!
The topic has been locked.
  • ritapas
  • ritapas's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 7 months ago #218713 by ritapas
Moreover, I'm not sure which absolute path I should use, since the page always points to a
Code:
/tmp/assets/e56e81b5/

path
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #218716 by tpartner
You can bypass the assets manager.

The absolute path should be something like:
Code:
https://example.com/limesurvey/upload/themes/survey/yourThemeName/files/OpenSans-Regular-webfont.woff

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose