It is currently March 9th, 2021, 10:49 am

variable text with image background

Help with creating, editing & fixing problems with skins
User avatar
ShadowDragon
Posts: 44
Joined: January 28th, 2021, 4:30 pm

Re: variable text with image background

Post by ShadowDragon »

If in some cases the text is longer and it doesn't fit in a single line, you probably will need to define them, along with a ClipString=1 option on the String meter.
Image is visible on my end, and also using backslashes.
as for the app name, I keep that in mind so it always fit, in case it doesn't, I keep the ClipString=1 in mind :)


when testing, not sure what the Divider=-1 exacly does, but it's working on 1 little thing.

when I open the menu, the text DOES NOT show, but once I hover over the first button and leave, it's working,
when I close the menu and open it, 3-5 min later, the sub menu name is visible.

while it didn't work entirely, when opening the submenu, the text was in the upper left coner,
I added the update + redraw to it (it didn't had redraw before when it isn't needed, but is required for this)

So that is working smoothly, but while I need to make some tiny undjestments, it will work nicely, probably need
the Y on everything + 50 else it probably wont work entirely, but it's an easy fix.

so I got 1 final question.

While font is set to "Arial" (I can change this), but so far, RainMeter is able to read every font,
regarding to this, the question:

FontFace=#FontName# (so this variable is readed

when I set it to for example:

if the Name of the font is no present on their system, and create a folder "Fonts"
do I also need in hte variable FontName=#@#Fonts\<FontNameHere> ?
to use the font inside that folder?

While the font is working with the name I want, (I think its default) "Colonna MT"
it works nicely.

if I dont need #@#Fonts\ than I can create the image, because it working smoothly :)
Thank you for the sweet help =) (I dont know how to give +1 or like if possible).
User avatar
balala
Rainmeter Sage
Posts: 12354
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: variable text with image background

Post by balala »

ShadowDragon wrote: February 20th, 2021, 6:49 pm Image is visible on my end, and also using backslashes.
Let's quote myself:
balala wrote: February 20th, 2021, 6:30 pm Note that even if the above ImageName option does work (and it definitely does),
So, I don't (and didn't) say it doesn't, however the correct form is always with backslash. This character is used in Windows environment to delimit folders. With slash it definitely does work, but the correct form of path is using backslash(s).
ShadowDragon wrote: February 20th, 2021, 6:49 pm when testing, not sure what the Divider=-1 exacly does, but it's working on 1 little thing.
Nothing. Such an option doesn't exist. UpdateDivider does, but simply Divider doesn't.
ShadowDragon wrote: February 20th, 2021, 6:49 pm when I open the menu, the text DOES NOT show, but once I hover over the first button and leave, it's working,
when I close the menu and open it, 3-5 min later, the sub menu name is visible.
3 - 5 minutes??? Share the code, please.
ShadowDragon wrote: February 20th, 2021, 6:49 pm if the Name of the font is no present on their system, and create a folder "Fonts"
do I also need in hte variable FontName=#@#Fonts\<FontNameHere> ?
to use the font inside that folder?
No, Place the .ttf or .otf file of your font to the @Resources\Fonts folder and use their family name. To get the family name of a font, double click the .ttf or .otf file and copy the name specified under Font Name there. Details here: https://docs.rainmeter.net/tips/fonts-guide/ (read the Using Fonts section).
User avatar
ShadowDragon
Posts: 44
Joined: January 28th, 2021, 4:30 pm

Re: variable text with image background

Post by ShadowDragon »

than I remove the divider part, while it doesn't do anything.
as for the FontFace= the font is working because it's in on my system.

I had the updateMeter "Text" meter not on my main sub, so it didn't show, so it does now
if you have readed a bit further :)

I only asked for the question if using a custom font not on your system or someone else
require =#@#Fonts\ and the name of the font behind.

if you just need the name, than I know enough, while the meter with the text is working nicely.
I need to find a nice font fitting to the menu =)

but ty for the explanation.
User avatar
balala
Rainmeter Sage
Posts: 12354
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: variable text with image background

Post by balala »

ShadowDragon wrote: February 20th, 2021, 8:27 pm I only asked for the question if using a custom font not on your system or someone else
require =#@#Fonts\ and the name of the font behind.
Exactly, and I replied:
balala wrote: February 20th, 2021, 7:18 pm No, Place the .ttf or .otf file of your font to the @Resources\Fonts folder and use their family name.
So no, don't use #@#Fonts\, just the family name of the font.
For instance attached you find a font: iec_symbol_font.ttf
To use it into a skin, place the iec_symbol_font.ttf file into the @Resources\Fonts folder of your config and in the String meter use this option: FontFace=IEC Unicode. No #@#Fonts\, no other things. Just FontFace=IEC Unicode.
You do not have the required permissions to view the files attached to this post.
User avatar
ShadowDragon
Posts: 44
Joined: January 28th, 2021, 4:30 pm

Re: variable text with image background

Post by ShadowDragon »

than I got 1 final question, on the documents, it does say IT wont work if you attached multiple
meter to a MeterStyle like:

MeterStyle=MyFirstParent | MySecondParent

but if I make style (basic stuff) as off:
- FontFace
-W + H
- Text (this can constantly without the need to reuse it!)
- etc

1 for the following:
Background
X + Y
and the necessary for that meter specific.

I can use the above MeterStyle as given in hte example in the document?
or does it only require 1 target?

(as side question), you do you use the code inside the text like you do? (green text)
User avatar
Active Colors
Moderator
Posts: 663
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: variable text with image background

Post by Active Colors »

ShadowDragon wrote: February 20th, 2021, 6:49 pm when testing, not sure what the Divider=-1 exacly does, but it's working on 1 little thing.
It is a good idea to read the manual first when you don't understand what an option does. The documentation is well structured and easy to follow. I suppose you meant UpdateDivider=-1, it is described in the documentation as well https://docs.rainmeter.net/manual-beta/meters/general-options/#UpdateDivider.
User avatar
Active Colors
Moderator
Posts: 663
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: variable text with image background

Post by Active Colors »

ShadowDragon wrote: February 21st, 2021, 8:08 am than I got 1 final question, on the documents, it does say IT wont work if you attached multiple
meter to a MeterStyle like:

MeterStyle=MyFirstParent | MySecondParent

but if I make style (basic stuff) as off:
- FontFace
-W + H
- Text (this can constantly without the need to reuse it!)
- etc

1 for the following:
Background
X + Y
and the necessary for that meter specific.

I can use the above MeterStyle as given in hte example in the document?
or does it only require 1 target?

(as side question), you do you use the code inside the text like you do? (green text)
You can apply several meterstyles to any Meter but it is not required. Only you can determine whether you need to apply more than one MeterStyle depending on your complexity or logic. You can even more than two meterstyles with a meter if you need. But we can't tell if you need them, only you can tell how you want your skin to be structured.

Keep in mind that any options from the following parent will override the previous one. What it means is that, for example, you have two meterstyles, and in the both you have a FontSize option.
Let's say something like this:

Code: Select all

[StyleBase]
X=10
Y=10
FontFace=Arial
FontSize=15
StringStyle=Bold
FontColor=255,0,0
AntiAlias=1

[StyleExtra]
FontSize=20

[MeterAppName]
Meter=String
MeterStyle=StyleBase | StyleExtra
[MeterAppName] will use the FontSize option from the StyleExtra meterstyle.
User avatar
Active Colors
Moderator
Posts: 663
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: variable text with image background

Post by Active Colors »

I am still waiting for some explanations of what exactly you want to create.
I understand that you want some application launcher but I haven't seen yet what kind of launcher you want and what kind behavior it should have.
That's why I asked for some graphical representation of how it should look overall so we can help you making it. If you describe every detail in a simple way it would be a lot more efficient.


I understand that you want to learn as well what Rainmeter is capable of and try doing by yourself but let us help you with making a basic launcher and you will be able to move on from there.
User avatar
ShadowDragon
Posts: 44
Joined: January 28th, 2021, 4:30 pm

Re: variable text with image background

Post by ShadowDragon »

the launcher is something I dont understand at all, this is a menu with 8 sub menu's.

the base text structure is something that apply to all.
background Width, Height, FontName, Font X (I have replaced FontAlign to LeftCenter, because CenterCenter
gave trouble, specially on the "text lenght"

but the base for text is applied to all 8.
However, the Background X and Y differs because of different position.
IF there is a way, to change the background X and Y respectively, I only need 2 meters to control all menu's with
the 2 settings I have.

Each background has it's own Group and Text for it as well, but the Base Text setting can be used.
I try to understand of the document for the settings I need only.

I also Though of something [!SetOption MeterName X "Number"] but it wont work.

Will see which one is most important, at least the FontSize, FontFace and FontAlign, AntiALias so I can use
meter Style for that part, so it doesn't repeated for each group, also a bit less code.

with Check tomorrow, also busy here, so I can respond late.

I puzzle around those line:

Main Text Style looks like:

Code: Select all

[GroupTextStyle]
FontFace=#FontName#
FontSize=24
FontColor=0,144,255
StringAlign=LeftCenter
AntiAlias=1
SolidColor=0,0,0,1
Activated with GroupName which are replicated meters (with their groupname attached and X, Y adjusted)

Code: Select all

[SubL1BG]
Meter=IMAGE
ImageName=#L1SubB#
X=175
Y=0
W=450
H=60
Group=L1

[SubL1T]
Meter=STRING
MeterStyle=GroupTextStyle
X=([SubL1BG:X]+60)
Y=([SubL1BG:Y]+([SubL1BG:H]/2))
Text=#L1SubN#
DynamicVariables=1
Group=L1
Now the GroupTextStyle does not have a text function, but that part is for each the same (at least 4 of those)
4 for the left side works with the first part, for the Right Part, I might need StringAlign: RightCenter but I need to
see how it looks like, otherwise, it functions nicely, so I will update it when I got time in the next week if nothing
comes in between =)

Change GroupStyleText to GroupStyleTextL and added 1 with GroupStyleTextR
L = left Aligned, and R = Right Aligned, I got some trouble of the text, while +60 didn't work, 5 min later,
I had the solution which was obvious Image Width (450 - 60) so on 390, now it's aligned perfectly.
I updated the other thread for a nice working preview with the preview, and I am really happy that it worked out.