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

TOPIC: Include new fonts in Limesurvey

Include new fonts in Limesurvey 1 year 4 months ago #98313

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5423
  • Thank you received: 307
  • Karma: 252
ajparag wrote:
Here is the link to automate translations:

www.limesurvey.org/en/forum/can-i-do-thi...lating-surveys#98306
Please add this information to our manual at manual.limesurvey.org/Workarounds:_Furth..._by_LimeSurvey_users.
The forum is cleaned up regularly, so sooner or later your valuable solution might get lost. Therefore, the manual is the better place.

Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Include new fonts in Limesurvey 1 year 1 day ago #101855

  • trivender
  • trivender's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 146
  • Thank you received: 7
  • Karma: 7
Hi,

I have gone through all following points

A. Install all new fonts in the Computer/ Server
B. Add language folders in ~\htdocs\locale
C. Go to ~\htdocs\application\helpers and insert commands for the desired languages in SurveyRuntimeHelper.php
D. Go to ~\ htdocs\third_party\ckeditor\_source\plugins\font and edit Plugin.js file using notepad++. Press ctrl+f and search for ‘verdana’. Add all the fonts that you have installed in step A.
E. Go to ~\htdocs\third_party\ckeditor and edit ckeditor.js file using notepad++. Press ctrl+f and search for ‘verdana’. Add all the fonts that you have installed in step A.

but I am not getting desired font in my language. Please see attached screenshot
ss.JPG
Trivender Singh
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 1 year 23 hours ago #101862

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2950
  • Thank you received: 377
  • Karma: 124
Well, one error would be that in your CSS the respective font is referenced at the end of font-family. The browser will start from the first font in the list, check if it is there, if yes, use it, if not move to the next. So to give priority to your font, it needs to be at the beginning of the list.

However, this font looks very strange and I doubt that many people will have it installed on their computer. However, CSS like this only works with fonts installed on the computer of the user. Therefor you will need to use very common fonts to make sure they are available on the computer of all users. Otherwise it looks good on your computer, but for all others it will look like in your example.

You might want to have a look into web-fonts. There are approaches that allow you to use fonts that are not installed on the users computer.

The fonts uploaded to the server are usually for the applications that create images.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Include new fonts in Limesurvey 1 year 22 hours ago #101868

  • trivender
  • trivender's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 146
  • Thank you received: 7
  • Karma: 7
Dear,

I know what you told be . I want to know which file I should edit so that my ttf will be infront of all all other ttf
Trivender Singh
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 1 year 20 hours ago #101872

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2950
  • Thank you received: 377
  • Karma: 124
Sorry, then I don't understand what you are trying to do.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Include new fonts in Limesurvey 1 year 18 hours ago #101875

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1146
  • Thank you received: 273
  • Karma: 79
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

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.
The following user(s) said Thank You: trivender

Include new fonts in Limesurvey 11 months 4 weeks ago #101887

  • trivender
  • trivender's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 146
  • Thank you received: 7
  • Karma: 7
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
Trivender Singh
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 11 months 4 weeks ago #101896

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6551
  • Thank you received: 868
  • Karma: 257
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: trivender

Include new fonts in Limesurvey 11 months 4 weeks ago #101903

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1146
  • Thank you received: 273
  • Karma: 79
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

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Last Edit: 11 months 4 weeks ago by Ben_V.
The administrator has disabled public write access.
The following user(s) said Thank You: trivender
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.237 seconds
Donation Image