• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Reducing font size causes letters to overlap.

Scheduled Pinned Locked Moved Custom CSS
5 Posts 2 Posters 449 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    atltiger81
    last edited by May 6, 2024, 3:32 AM

    I reduced the font size of the Compliments module in custom.css, which was straight forward. But the smaller the font size, the more the individual letters overlap. At 30px, every letter is jammed together and touching, and at 20px they’re overlapping and almost unreadable.
    I’ve tried changing to various different fonts, but they all behave the same as font size decreases. I’ve searched this forum and everywhere for a solution, but have not seen this problem mentioned. There are modules currently running in my MM with much smaller fonts natively that all look fine, so I’m perplexed about the cause and how to resolve.

    S 1 Reply Last reply May 6, 2024, 11:37 AM Reply Quote 0
    • S Offline
      sdetweil @atltiger81
      last edited by sdetweil May 6, 2024, 12:54 PM May 6, 2024, 11:37 AM

      @atltiger81 this typically doesn’t happen

      I don’t know but you can look at the font size settings for small, medium, and large in main.css and compare it to what you are doing

      sounds like you modified the spacing, not just the size

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      A 1 Reply Last reply May 6, 2024, 3:25 PM Reply Quote 0
      • A Offline
        atltiger81 @sdetweil
        last edited by May 6, 2024, 3:25 PM

        @sdetweil
        I don’t know how the character spacing is being modified, since my only code in custom.css is:

        .compliments .xlarge {
          font-size: 30px;
          margin.bottom: -35px;
        }
        

        From your suggestion, I checked main.css and it shows the font sizes as:
        font-size: 20px;
        font-size-xsmall: 0.75rem;
        font-size-small: 1rem;
        font-size-medium: 1.5rem;
        font-size-large: 3.25rem;
        font-size-xlarge: 3.75rem;

        I haven’t modified anything else. The only modules I’m running are MMM-OpenWeatherForecast, clock, and compliments. Anything else I can check?

        A 1 Reply Last reply Jun 19, 2024, 4:21 AM Reply Quote 0
        • A Offline
          atltiger81 @atltiger81
          last edited by Jun 19, 2024, 4:21 AM

          @atltiger81 I finally figured this out. Here’s the solution to reduce the font size of the compliments module without the letters of text jamming together. Using custom.css to override the “xlarge” font to a smaller px size as suggested above won’t work. The xlarge font character spacing distorts more and more the smaller the specified size. You need to change the font in the compliments.js file itself from xlarge to medium or small (whichever size you prefer). Here’s the specific line of code in that file to edit (line 144 as viewed on github, or thereabouts):

          wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright pre-line";
          
          S 1 Reply Last reply Jun 19, 2024, 11:12 AM Reply Quote 0
          • S Offline
            sdetweil @atltiger81
            last edited by Jun 19, 2024, 11:12 AM

            @atltiger81 no, don’t change the code

            just add a classes property to the compliments module config

            {
               module:"compliments",
                position:"....",
                config: {
                    compliments:  {
                     ...
                     ...
                     },
                     classes:"..........  whatever"
                  }
            }
            

            from the doc
            1000026352.jpg

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 1
            • 1 / 1
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy