View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
19909Bug reportsSurvey editingpublic2025-02-20 16:02
Reporter2BITS_PL Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status resolvedResolutionfixed 
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 heat4
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

gabrieljenik

gabrieljenik

2025-02-11 14:11

manager   ~82001

Issue #1 & #3:
https://github.com/LimeSurvey/LimeSurvey/pull/4165

Issue #2
https://github.com/LimeSurvey/LimeSurvey/pull/4166

About Issue #2

Looks like a bug as in 3.x styles are effectively showed and now it doesn't. Think it's simply because before the Theme Options were rendered with the options.twig file of each theme, and in that file the packages were registered with the CSS of each font. Now the options are rendered with options_core.html, and the packages are not registered there.
What the fix does is register all the necessary packages.

Stil, although it seems like a porting issue, it is also likely this could be a decision to abandon the preview function of the sources, so as not to have to load so many packages, its impact in performance and number of requests.

tibor.pacalat

tibor.pacalat

2025-02-17 14:55

administrator   ~82039

Hey @gabrieljenik I noticed that .large-heading class overwrites picked font.

gabrieljenik

gabrieljenik

2025-02-18 15:22

manager   ~82069

I would handle it separately... That's something specific on Fruity TwentyThree.
Also, we would need to review why it was set, for which purpose ... it is not related to this ticket I think, but to a new one.

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
2025-02-03 11:10 tibor.pacalat Assigned To => gabrieljenik
2025-02-03 11:10 tibor.pacalat Status new => assigned
2025-02-11 14:11 gabrieljenik Assigned To gabrieljenik => DenisChenu
2025-02-11 14:11 gabrieljenik Status assigned => ready for code review
2025-02-11 14:11 gabrieljenik Note Added: 82001
2025-02-11 14:11 gabrieljenik Bug heat 0 => 2
2025-02-17 14:55 tibor.pacalat Note Added: 82039
2025-02-17 14:55 tibor.pacalat Bug heat 2 => 4
2025-02-17 14:55 tibor.pacalat Assigned To DenisChenu => gabrieljenik
2025-02-18 15:22 gabrieljenik Note Added: 82069
2025-02-20 16:02 tibor.pacalat Status ready for code review => resolved
2025-02-20 16:02 tibor.pacalat Resolution open => fixed