INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Font in expression  (Read 413 times)

SkGe

  • Galactic Citizen
  • ****
  • Posts: 424
Font in expression
« on: July 25, 2021, 03:54:14 pm »

Hello.
When using custom fonts in expression, it seems that MC don't show the font correctly. I'm using ubuntu condensed as the main font on MC but when using this in expression it always shows me the last ... which I want to remove it from my expression.
If I change the font to different one, it removes ....
My expression example is this:
Code: [Select]
if(isempty([amg composer]), <font face="ubuntu condensed"size="100">[name]<//font>, <font face="ubuntu condensed"size="100">IfElse([composer], [name]<//font>
<font color="2184C6">[composer]<//font>)&datatype=[list])
If I change the size of the font it removes this ... along to the name, but if I keep at 100 (default) the ... stay along with the name.
Ubuntu condensed at 100 or as default it looks like down in image:

Ubuntu condensed at 90 in expression don't have the ...

Any thoughts?!
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2396
Re: Font in expression
« Reply #1 on: July 26, 2021, 03:54:03 am »

It's not the font size. Your expression has 2 lines, and since MC can only show one line, it prints the ellipsis to indicate that there's more text. This also happens if you end an expression with a newline (enter) which adds a blank second line.

You need to write your expression as a single line, or end each line with '/' to tell MC to ignore the line break.

Also... Your expression doesn't make much sense  :)  it says:
- if there isn't an [AMG composer], print [name]
- else, if there's a [composer], print [name] followed by [composer] in a different color and on the second line (so not visible)
- if there's also no [composer]... print nothing Just print [composer] on the second line (so, only a blank line with ellipsis would be shown)

I'm assuming this is not what you want...
Logged

SkGe

  • Galactic Citizen
  • ****
  • Posts: 424
Re: Font in expression
« Reply #2 on: July 26, 2021, 06:48:29 am »

I know that expression has double lines, but this is not the issue. The issue is, when using different fonts in expression, don't have this problem adding the ellipsis. But only the one which is the default font for MC.
Here is the first example:

And second one:

When changing the main font to say "Segoe UI", it has the same rendering problem showing the font with the ellipsis. But changing the font size it will stop adding the ellipsis.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2396
Re: Font in expression
« Reply #3 on: July 26, 2021, 06:53:51 am »

Please paste those expressions as text so that I don't need to type them.
Also, note that the '&datatype=list' only works if it's the very last thing on the expression. It needs to come after the fixspacing() closing parenthesis.
Logged

SkGe

  • Galactic Citizen
  • ****
  • Posts: 424
Re: Font in expression
« Reply #4 on: July 26, 2021, 06:56:50 am »

Here is the expression.
Code: [Select]
fixspacing(if(isempty([amg composer]), <font face="ubuntu condensed"size="100">[name]<//font>, <font face="ubuntu condensed"size="100">IfElse([amg composer], [name]<//font>
<font color="2184C6">[amg composer]<//font>)&datatype=[list]), 2)
You can change the font to your main default and see yourself.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2396
Re: Font in expression
« Reply #5 on: July 26, 2021, 07:22:57 am »

I installed that font to be sure (on Windows). There are 2 lines of text, but it looks like MC suppresses the ellipsis when there's html formatting on the expression (or some other rule, I'm not sure)

I think the problem could be the mode 2 on the fixspacing()... I think there's no mode 2? When I use mode 2, I get the ellipsis regardless of which font I use. When I use mode 1, it works without ellipsis with both fonts.

This simplified expression also works with both fonts for me (also adding "size" if needed):
Code: [Select]
<font face="Ubuntu Condensed">[Name]if(isempty([AMG Composer]),,<font color="2184C6">
[AMG Composer])

or

Code: [Select]
<font face="Ubuntu Condensed">fixspacing([Name]if(isempty([AMG Composer]),,<font color="2184C6">
[AMG Composer]),1)

Edit: Note that a single whitespace at the end of the first line will cause the ellipsis to show up. The whitespace rules in expressions are a bit weird - whitespace is ignored right after a comma in an expression but not after an html tag, so if there's a space there MC will consider it as text and add the ellipsis to indicate there's something there.
Logged
Pages: [1]   Go Up