Check out the LimeSurvey source code on GitHub!

Include new fonts in Limesurvey

More
3 years 3 months ago #101875 by Ben_V

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

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: first

Please Log in to join the conversation.

More
3 years 3 months ago #101887 by first
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."

Please Log in to join the conversation.

More
3 years 3 months ago #101896 by DenisChenu
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

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
The following user(s) said Thank You: first

Please Log in to join the conversation.

More
3 years 3 months ago - 3 years 3 months ago #101903 by Ben_V
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

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 3 years 3 months ago by Ben_V.
The following user(s) said Thank You: first

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form