Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Include new fonts in Limesurvey

Include new fonts in Limesurvey 2 years 2 months ago #101875

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1596
  • Thank you received: 391
  • Karma: 103
I want to know which file I should edit...

Hi,
You have to edit related CSS rules the most of the time into template.css; Order fonts into "font-family" declarations (priority fonts first):
@font-face
{
font-family: MyCustomFont;
src: url('MyCustomFont.ttf'),
     url('MyCustomFont.eot'); /* for IE9 */
}
* {font-family:'MyCustomFont',Courier,System,Terminal,Consolas}
Benoît
The administrator has disabled public write access.
The following user(s) said Thank You: OMdev

Include new fonts in Limesurvey 2 years 2 months ago #101887

  • OMdev
  • OMdev's Avatar
  • Offline
  • Gold Lime
  • Posts: 246
  • Thank you received: 25
  • Karma: 14
Thank you Ben, you suggestion will work perfectly if my survey is in only one custum language. But my survey is in 4 languages each having custom font. My question is how can make each language custom font as priorty font when I run survey in that language. I dont want to hardcode any one font highest priority
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
The administrator has disabled public write access.

Include new fonts in Limesurvey 2 years 2 months ago #101896

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 8249
  • Thank you received: 1124
  • Karma: 335
Hi,

You can use :lang() pseudo selector.

www.w3.org/International/questions/qa-css-lang
:lang(en) {font-family:'MyCustomFontEn',Courier,System,Terminal,Consolas}
:lang(fr) {font-family:'MyCustomFontFr',Courier,System,Terminal,Consolas}

Denis
The administrator has disabled public write access.
The following user(s) said Thank You: OMdev

Include new fonts in Limesurvey 2 years 2 months ago #101903

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1596
  • Thank you received: 391
  • Karma: 103
In addition of Denis's solution you can also:

1) Use the {LANG} keyword and add (startpage.pstpl) a link to an extra .CSS file, where you will just set or change the font-familly.
eg. <link rel='stylesheet' type='text/css' media='all' href='yourinstall.com/templates/yourtemplate/font_{LANG}.css' />


2) Change the font into the survey description field using jquery
<script type="text/javascript">
$(document).ready(function(){
$( "<style type='text/css'>"
+"* { font-family:MyCustomFont !IMPORTANT }"
+"</style>").appendTo( "head" );
});
</script>

(NOTE: it's not very W3C compliant but if you prefer you can directly insert a link to an additional stylesheet in the description field without use of javascript:
<link rel='stylesheet' type='text/css' media='all' href='yourinstall.com/templates/yourtemplate/MyCustomFont.css' />)
.
Benoît
Last Edit: 2 years 2 months ago by Ben_V.
The administrator has disabled public write access.
The following user(s) said Thank You: OMdev
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.150 seconds