Character Reference Variables 文字参照変数

Often you will want to use a symbol in your skin design, perhaps for a media player like ▶︎ or ⏸︎, a language character like ඌ︎ or 乫︎, or other UI elements like ↻︎ or ☑︎ or even just a degree symbol like °︎.多くの場合、あなたはおそらくのようなメディアプレーヤーのために、おスキンのデザインで記号を使用したいと思うでしょう??または??、などの言語の文字??または??、など他のUI要素??または??あるいは単に度のシンボル°?が好きです。

You can use an Image meter with a .png of the image you want, however that can mean an extra meter in your skin code, and another file that you need to include when you distribute your skin. In addition, changing the color or size of the image can be problematic. An alternative is to use Unicode characters in a String meter.あなたが欲しいイメージの.pngでImageメーターを使うことができます、しかしそれはあなたのスキンコードの余分なメーター、そしてあなたがあなたのスキンを配布するときあなたが含む必要がある別のファイルを意味することができます。さらに、画像の色やサイズを変更すると問題が生じる可能性があります。代替手段は、文字列メーターUnicode文字を使用することです。

While you can simply copy and paste a Unicode character into your skin code, there are some issues with that:スキンコードにUnicode文字を簡単にコピーして貼り付けることができますが、いくつか問題があります。

  • You must be sure to encode your skin .ini file as UTF-16 Little Endian.スキンの.iniファイルは必ずUTF-16リトルエンディアンとしてエンコードしてください。
  • While the font you are using for your skin may support the character(s), the font in your text editor may not. This can make it hard to work on your skin.あなたがあなたのスキンに使っているフォントは文字をサポートしているかもしれませんが、あなたのテキストエディタのフォントはサポートしていないかもしれません。これはあなたのスキンに働きにくくすることができます。
  • The majority of the 65,536 Unicode characters and symbols below (U+FFFE), the Basic Multilingual Plane, are well supported in popular fonts you will use. Characters above (U+FFFE) are not as well supported by fonts and not supported at all in Rainmeter. That is where an "icon" font like FontAwesome comes in, more on that in a bit.以下の65,536のUnicode文字と記号(U + FFFE)の大部分、基本多言語面は、使用する一般的なフォントでよくサポートされています。上記の文字(U + FFFE)は、フォントではあまりサポートされておらず、Rainmeterではまったくサポートされていません。それが、FontAwesomeのような「アイコン」フォントが登場するところです。

Using Character Variables in RainmeterRainmeterでの文字変数の使用

The syntax for creating a plain-text reference to a Unicode text or symbol character is:Unicodeテキストまたはシンボル文字へのプレーンテキスト参照を作成するための構文は、次のとおりです。

  • [\x2622] : hexadecimal Unicode value. Allowed range is x0-xFFFE.[\ x2622]:16進数のUnicode値。許容範囲はx0-xFFFEです。
  • [\9762] : decimal Unicode value. Allowed range is 0-65536.[\ 9762]:10進数のUnicode値。許容範囲は0〜65536です。
  • In this example, either variant will produce the ☢︎ character.この例では、どちらの変種も??文字を生成します。

Example: Text=Caution, radioactivity [\x2622] ahead!例: Text=Caution, radioactivity [\x2622] ahead!

These are font characters like any other, and can be modified with FontSize, FontColor and other effects.これらは他のフォント文字と同じで、FontSize、FontColor、その他の効果で変更できます。

Character Reference Variables use the nested variables syntax of a [ followed by some variable identifier, \ in this case, and a value followed by an ending ]. This means they can be nested with other variables and section variables using this syntax.文字参照変数は、aの[後に何らかの変数識別子(\この場合)と、値の後に末尾が続くという入れ子になった変数の構文を使用します]。これは、この構文を使用して他の変数やセクション変数とそれらをネストできることを意味します。

Examples: Text=[\[&MeasureName]] or Text=[\[#VariableName]]例:Text=[\[&MeasureName]]またはText=[\[#VariableName]]

Finding those Unicode valuesそれらのUnicode値を見つける

There are two general ways to find characters and symbols to use in your skins:スキンで使用する文字と記号を見つける一般的な方法は2つあります。

Standard Unicode characters in the Basic Multilingual Plane as defined by the Unicode Consortium. One good reference to these can be found at Unicode Character Table. Simply select a desired character, and for example with our ☢︎ above, it will display both the Unicode (U+2622) and HTML (☢) values for the character. It is up to you whether you want to use hex or decimal, although hex may be more common outside of HTML. Then use those numeric values in the syntax described above.Unicodeコンソーシアムで定義されているBasic Multilingual Planeの標準Unicode文字。これらに関する優れた参考文献がUnicode Character Tableにあります。目的の文字を選択するだけで、たとえば上記のwith?では、その文字のUnicode(U + 2622)とHTML(☢)の両方の値が表示されます。16進数を使用するか10進数を使用するかは、ユーザー次第ですが、16進数はHTML以外ではより一般的な場合があります。その後、上記の構文でそれらの数値を使用します。

Most quality fonts, certainly most of the popular ones that are included with Windows, as well as ones available from Google Fonts and other resources, will support the majority of these characters. There should be no need to install or use any special font, other than what is visually pleasing for your skin design.ほとんどの高品質フォント、確かにWindowsに含まれている人気フォントのほとんど、およびGoogle Fontsおよびその他のリソースから入手可能なフォントは、これらの文字の大部分をサポートします。あなたのスキンのデザインにとって視覚的に楽しいもの以外は、特別なフォントをインストールしたり使用したりする必要はないはずです。

An "icon" font. Again, since the use of characters outside the Basic Multilingual Plane, above xFFFE, is not supported by many fonts, and not at all by Rainmeter, it may be useful to look at using a specialized "icon" font, which will map many new, unusual, and popular symbols into the allowed range. They often also have unique images that can be of use in your skins.「アイコン」フォント 繰り返しになりますが、xFFFEを超える基本多言語面以外の文字の使用は多くのフォントではサポートされておらず、Rainmeterでもまったくサポートされていません。 、珍しい、そして人気のあるシンボルは、許容範囲内。彼らはしばしばあなたのスキンに役立つことができるユニークな画像を持っています。

While there are a lot of these types of fonts available, here are a few popular examples:利用可能なこれらの種類のフォントはたくさんありますが、ここにいくつかの一般的な例があります。

Again, select a desired character to obtain either the Unicode or HTML character values. Use those numeric values with the syntax above in Rainmeter.再度、目的の文字を選択して、UnicodeまたはHTMLの文字値を取得してください。Rainmeterで上記の構文でそれらの数値を使用してください。

The difference is that using these fonts will require that you place the font .ttf or .otf file in the @Resources\Fonts folder in the root config of your skin, and use the family name of the font with the FontFace option in a String meter to display them.違いは、これらのフォントを使用するには、フォントの.ttfファイルまたは.otfファイルをスキンのルート設定の@Resources \ Fontsフォルダに配置し、フォントのファミリ名をStringのFontFaceオプションで使用する必要があることです。それらを表示するメーター。

Example

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

; These should work with any decent font
; https://unicode-table.com/en/
; https://en.wikipedia.org/wiki/Unicode

; These require that the appropriate font be in @Resources\Fonts
; They are all there in this skin if you want / need them
; http://fontawesome.io/cheatsheet/
; https://material.io/icons/
; https://github.com/google/material-design-icons/tree/master/iconfont
; http://icofont.com/

; Note that Rainmeter (and most fonts) only supports characters below [\65534] or [\xfffe]
; This is the Basic Multilingual Plane in Unicode
; https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane

[Variables]
; One way to keep track of what's what is to use Variables to name characters you use
fa-Raindrop=[\xf043]
u-Degree=[\x00B0]

[MeterChars]
Meter=String
; Use any font you like for text and most Unicode characters
;FontFace=Fira Sans
FontSize=20
FontWeight=500
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
; Use the font family name for fonts that have specialized characters
; Note that | means "or" in InlinePattern
InlineSetting=Face | FontAwesome
InlinePattern=[\xf0e7]|#fa-Raindrop#|[\xf241]|[\x26C6]|[\xf0a9]
InlineSetting2=Color | 242,216,162,255
InlinePattern2=[\xf0e7]
InlineSetting3=Color | 162,204,242,255
InlinePattern3=[\xf043]
InlineSetting4=Color | 242,104,104,255
InlinePattern4=[\xf0a9]
Text=Hello [\x27BD] [\xf0e7] #fa-Raindrop# [\xf241] [\xf0a9] #u-Degree# World

関連記事

スポンサーリンク

ROUND関数 まるめる

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る