View Issue Details

This bug affects 1 person(s).
 0
IDProjectCategoryView StatusLast Update
19909Bug reportsSurvey editingpublic2024-12-20 17:28
Reporter2BITS_PL Assigned To 
PrioritynoneSeverityminor 
Status newResolutionopen 
Product Version6.6.x 
Summary19909: Issues with font handling in the custom configuration of the survey theme.
Description

While configuring a custom survey theme in LimeSurvey, I encountered several issues related to font handling:

  1. Font changes are not applied in the survey frontend:

    • After selecting or changing a font in the theme configuration, the font is not applied in the survey frontend.
    • Example Solution: Adding the code from the attached file custom_font_fix.twig to custom_header.twig resolves this issue by allowing the appropriate font packages to be registered in the survey template.
  2. Fonts are not displayed in the dropdown list:

    • The font selection dropdown in the theme configuration should display options styled according to the fonts they represent using assigned CSS classes.
    • In practice, these CSS classes are not properly applied, so the select options do not display the fonts as intended.
  3. Server-side fonts are not applied:

    • Despite the fix in (1), server-side fonts (e.g., ibm-sans, roboto, opensans) are loaded but not applied in the survey frontend.
    • In DevTools, the fonts are visible as loaded, but they are not used on the page.

This issue also occurs on the LimeSurvey demo site in the latest version of LimeSurvey.

Steps To Reproduce

Steps to Reproduce the Issue:

  • Create a new survey and configure custom theme options.
  • Select any font from the available options.
  • Check the survey frontend – the font change is not applied.
  • In DevTools, verify that server-side fonts are loaded but not applied.

Expected Behavior:

  • The selected font should appear in the survey frontend without requiring additional template modifications.
  • The font selection dropdown should render options with the correct font styles.
  • Server-side fonts should be applied in the survey frontend after being loaded.
TagsNo tags attached.
Attached Files
custom_font_fix.twig (627 bytes)   
{% set browser_fonts = [
    'georgia', 'palatino', 'times_new_roman',
    'arial', 'arial_black', 'comic_sans',
    'impact', 'lucida_sans', 'trebuchet',
    'courier', 'lucida_console'
] %}

{% set server_fonts = [
    'ibm-sans', 'ibm-serif', 'icomoon',
    'lato', 'news_cycle', 'noto',
    'roboto', 'opensans', 'source-sans-pro',
    'raleway', 'ubuntu'
] %}

{% set selected_font = aSurveyInfo.options.font %}

{% if selected_font in browser_fonts %}
    {{ registerPackage('font-websafe') }}
{% elseif selected_font in server_fonts %}
    {{ registerPackage('font-' ~ selected_font) }}
{% endif %}
custom_font_fix.twig (627 bytes)   
Bug heat0
Complete LimeSurvey version number (& build)6.8.1
I will donate to the project if issue is resolvedNo
Browser
Database type & versionSQL Server 2022
Server OS (if known)
Webserver software & version (if known)
PHP Versionv8.1.29 NTS x64

Users monitoring this issue

There are no users monitoring this issue.

Activities

Issue History

Date Modified Username Field Change
2024-12-20 17:28 2BITS_PL New Issue
2024-12-20 17:28 2BITS_PL File Added: custom_font_fix.twig