Commit 42adbf00 authored by coppro's avatar coppro

Allowed symbol fonts to feature multiple symbols with text capability and...

Allowed symbol fonts to feature multiple symbols with text capability and multiple regex-matched symbols.
parent 3af97de7
mse version: 0.3.5 mse version: 0.3.5
version: 2007-10-13 version: 2007-10-13
image font size: 46 image font size: 46
...@@ -176,15 +176,16 @@ symbol: ...@@ -176,15 +176,16 @@ symbol:
image: z.png image: z.png
symbol: symbol:
code: code:
draw_text: 0
image: space.png image: space.png
text font: text font:
name: MPlantin name: MPlantin
size: 1 size: 1
color: rgb(225,198,77) color: rgb(225,198,77)
text margin left: .26 text margin left: .26
text margin right: .2 text margin right: .2
text margin top: -.12 text margin top: -.12
text margin bottom: -.12 text margin bottom: -.12
############################################################## ##############################################################
......
mse version: 0.3.6 mse version: 0.3.6
version: 2008-04-01 version: 2008-04-01
short name: beveled style (firepenguinmaster) short name: beveled style (firepenguinmaster)
position hint: 101 position hint: 101
...@@ -14,8 +14,6 @@ icon: mana_r.png ...@@ -14,8 +14,6 @@ icon: mana_r.png
image font size: 135 image font size: 135
horizontal space: 2 horizontal space: 2
symbol:
image: mana_circle.png
symbol: symbol:
code: T code: T
image: mana_t_older.png image: mana_t_older.png
...@@ -202,16 +200,18 @@ symbol: ...@@ -202,16 +200,18 @@ symbol:
symbol: symbol:
code: I code: I
image: mana_infinite.png image: mana_infinite.png
as text: .|[0-9]+(?!/) symbol:
text font: image: mana_circle.png
name: MPlantin code: [0-9]+|.
size: 1 text font:
color: rgb(0,0,0) name: MPlantin
max stretch: 0.5 size: 1
text margin left: .24 color: rgb(0,0,0)
text margin right: .24 max stretch: 0.5
text margin top: -.16 text margin left: .24
text margin bottom: -.12 text margin right: .24
text margin top: -.16
text margin bottom: -.12
############################################################## ##############################################################
# Insert-symbol menu # Insert-symbol menu
......
mse version: 0.3.6 mse version: 0.3.6
version: 2008-04-01 version: 2008-04-01
# Symbol font in the 'futuristic' style, used for casting costs on futureshift cards # Symbol font in the 'futuristic' style, used for casting costs on futureshift cards
short name: Future Sight style short name: Future Sight style
...@@ -7,24 +7,6 @@ icon: mana_r.png ...@@ -7,24 +7,6 @@ icon: mana_r.png
image font size: 135 image font size: 135
horizontal space: 2 horizontal space: 2
symbol:
image: mana_circle_w.png
enabled: { colorless_color() == "w" }
symbol:
image: mana_circle_u.png
enabled: { colorless_color() == "u" }
symbol:
image: mana_circle_b.png
enabled: { colorless_color() == "b" }
symbol:
image: mana_circle_r.png
enabled: { colorless_color() == "r" }
symbol:
image: mana_circle_g.png
enabled: { colorless_color() == "g" }
symbol:
image: mana_circle.png
enabled: { colorless_color() == "c" }
symbol: symbol:
code: T code: T
image: mana_t.png image: mana_t.png
...@@ -146,17 +128,90 @@ symbol: ...@@ -146,17 +128,90 @@ symbol:
symbol: symbol:
code: I code: I
image: mana_infinite.png image: mana_infinite.png
as text: .|[0-9]+(?!/) symbol:
text font: image: mana_circle_w.png
name: MPlantin enabled: { colorless_color() == "w" }
weight: bold code: .|[0-9]+(?!/)
size: 1 text font:
color: rgb(0,0,0) name: MPlantin
max stretch: 0.5 weight: bold
text margin left: .35 size: 1
text margin right: .3 color: rgb(0,0,0)
text margin top: 0.1 max stretch: 0.5
text margin bottom: 0.1 text margin left: .35
text margin right: .3
text margin top: 0.1
text margin bottom: 0.1
symbol:
image: mana_circle_u.png
enabled: { colorless_color() == "u" }
code: .|[0-9]+(?!/)
text font:
name: MPlantin
weight: bold
size: 1
color: rgb(0,0,0)
max stretch: 0.5
text margin left: .35
text margin right: .3
text margin top: 0.1
text margin bottom: 0.1
symbol:
image: mana_circle_b.png
enabled: { colorless_color() == "b" }
code: .|[0-9]+(?!/)
text font:
name: MPlantin
weight: bold
size: 1
color: rgb(0,0,0)
max stretch: 0.5
text margin left: .35
text margin right: .3
text margin top: 0.1
text margin bottom: 0.1
symbol:
image: mana_circle_r.png
enabled: { colorless_color() == "r" }
code: .|[0-9]+(?!/)
text font:
name: MPlantin
weight: bold
size: 1
color: rgb(0,0,0)
max stretch: 0.5
text margin left: .35
text margin right: .3
text margin top: 0.1
text margin bottom: 0.1
symbol:
image: mana_circle_g.png
enabled: { colorless_color() == "g" }
code: .|[0-9]+(?!/)
text font:
name: MPlantin
weight: bold
size: 1
color: rgb(0,0,0)
max stretch: 0.5
text margin left: .35
text margin right: .3
text margin top: 0.1
text margin bottom: 0.1
symbol:
image: mana_circle.png
enabled: { colorless_color() == "c" }
code: .|[0-9]+(?!/)
text font:
name: MPlantin
weight: bold
size: 1
color: rgb(0,0,0)
max stretch: 0.5
text margin left: .35
text margin right: .3
text margin top: 0.1
text margin bottom: 0.1
############################################################## ##############################################################
# Insert-symbol menu # Insert-symbol menu
......
mse version: 0.3.6 mse version: 0.3.6
version: 2008-04-01 version: 2008-04-01
# Symbol font in the 'popup' style, used for casting costs on modern cards # Symbol font in the 'popup' style, used for casting costs on modern cards
short name: popup style short name: popup style
...@@ -7,8 +7,6 @@ icon: mana_r.png ...@@ -7,8 +7,6 @@ icon: mana_r.png
image font size: 135 image font size: 135
horizontal space: 2 horizontal space: 2
symbol:
image: mana_circle.png
symbol: symbol:
code: T code: T
image: mana_t_older.png image: mana_t_older.png
...@@ -215,17 +213,20 @@ symbol: ...@@ -215,17 +213,20 @@ symbol:
symbol: symbol:
code: I code: I
image: mana_infinite.png image: mana_infinite.png
as text: [0-9]+(?!/) symbol:
text font: image: mana_circle.png
name: MPlantin text margin left: .28
size: 1 text margin right: .20
color: rgb(0,0,0) text margin top: -.15
max stretch: 0.5 text margin bottom: -.06
text margin left: .28 code: [0-9]+|.
text margin right: .20 regex: yes
text margin top: -.15 draw text: 0
text margin bottom: -.06 text font:
name: MPlantin
size: 1
color: rgb(0,0,0)
max stretch: 0.5
############################################################## ##############################################################
# Insert-symbol menu # Insert-symbol menu
......
mse version: 0.3.6 mse version: 0.3.6
version: 2008-04-01 version: 2008-04-01
short name: normal (colorless) short name: normal (colorless)
position hint: 21 position hint: 21
...@@ -14,8 +14,6 @@ icon: mana_r.png ...@@ -14,8 +14,6 @@ icon: mana_r.png
image font size: 135 image font size: 135
horizontal space: 2 horizontal space: 2
symbol:
image: mana_circle.png
symbol: symbol:
code: T code: T
image: mana_t_older.png image: mana_t_older.png
...@@ -222,16 +220,18 @@ symbol: ...@@ -222,16 +220,18 @@ symbol:
symbol: symbol:
code: I code: I
image: mana_infinite.png image: mana_infinite.png
as text: .|[0-9]+(?!/) symbol:
text font: image: mana_circle.png
name: MPlantin code: .|[0-9]+(?!/)
size: 1 text font:
color: rgb(0,0,0) name: MPlantin
max stretch: 0.5 size: 1
text margin left: .26 color: rgb(0,0,0)
text margin right: .2 max stretch: 0.5
text margin top: -.14 text margin left: .26
text margin bottom: -.14 text margin right: .2
text margin top: -.14
text margin bottom: -.14
############################################################## ##############################################################
# Insert-symbol menu # Insert-symbol menu
......
mse version: 0.3.6 mse version: 0.3.6
version: 2008-04-01 version: 2008-04-01
short name: normal short name: normal
position hint: 001 position hint: 001
...@@ -14,8 +14,6 @@ icon: mana_r.png ...@@ -14,8 +14,6 @@ icon: mana_r.png
image font size: 135 image font size: 135
horizontal space: 2 horizontal space: 2
symbol:
image: mana_circle.png
symbol: symbol:
code: T code: T
image: mana_t_older.png image: mana_t_older.png
...@@ -222,17 +220,20 @@ symbol: ...@@ -222,17 +220,20 @@ symbol:
symbol: symbol:
code: I code: I
image: mana_infinite.png image: mana_infinite.png
as text: .|[0-9]+(?!/) symbol:
text font: image: mana_circle.png
name: MPlantin code: [0-9]+|.
size: 1 regex: yes
color: rgb(0,0,0) draw text: 0
max stretch: 0.5 text margin left: .26
text margin left: .26 text margin right: .2
text margin right: .2 text margin top: -.14
text margin top: -.14 text margin bottom: -.14
text margin bottom: -.14 text font:
name: MPlantin
size: 1
color: rgb(0,0,0)
max stretch: 0.5
############################################################## ##############################################################
# Insert-symbol menu # Insert-symbol menu
insert symbol menu: insert symbol menu:
......
This diff is collapsed.
...@@ -39,11 +39,12 @@ class SymbolFont : public Packaged { ...@@ -39,11 +39,12 @@ class SymbolFont : public Packaged {
/// A symbol to be drawn /// A symbol to be drawn
class DrawableSymbol { class DrawableSymbol {
public: public:
inline DrawableSymbol(const String& text, SymbolInFont* symbol) inline DrawableSymbol(const String& text, const String& draw_text, SymbolInFont* symbol)
: text(text), symbol(symbol) : text(text), draw_text(draw_text), symbol(symbol)
{} {}
String text; ///< Original text String text; ///< Original text
String draw_text;///< Text to draw (extracted from the regex to avoid performance costs)
SymbolInFont* symbol; ///< Symbol to draw, if nullptr, use the default symbol and draw the text SymbolInFont* symbol; ///< Symbol to draw, if nullptr, use the default symbol and draw the text
}; };
typedef vector<DrawableSymbol> SplitSymbols; typedef vector<DrawableSymbol> SplitSymbols;
...@@ -85,15 +86,8 @@ class SymbolFont : public Packaged { ...@@ -85,15 +86,8 @@ class SymbolFont : public Packaged {
RealSize spacing; ///< Spacing between sybmols (for the default font size) RealSize spacing; ///< Spacing between sybmols (for the default font size)
// writing text // writing text
bool scale_text; ///< Should text be scaled down to fit in a symbol? bool scale_text; ///< Should text be scaled down to fit in a symbol?
FontP text_font; ///< Font to use for missing symbols
double text_margin_left;
double text_margin_right;
double text_margin_top;
double text_margin_bottom;
Alignment text_alignment; Alignment text_alignment;
bool merge_numbers; ///< Merge numbers? e.g. "11" is a single symbol ('1' must not exist as a symbol) bool merge_numbers; ///< Merge numbers? e.g. "11" is a single symbol ('1' must not exist as a symbol)
String as_text; ///< Things to render as text
mutable wxRegEx as_text_r;
InsertSymbolMenuP insert_symbol_menu; InsertSymbolMenuP insert_symbol_menu;
wxMenu* processed_insert_symbol_menu; wxMenu* processed_insert_symbol_menu;
...@@ -106,9 +100,7 @@ class SymbolFont : public Packaged { ...@@ -106,9 +100,7 @@ class SymbolFont : public Packaged {
SymbolInFont* defaultSymbol() const; SymbolInFont* defaultSymbol() const;
/// Draws a single symbol inside the given rectangle /// Draws a single symbol inside the given rectangle
void drawSymbol (RotatedDC& dc, const RealRect& rect, double font_size, const Alignment& align, SymbolInFont& sym); void drawSymbol (RotatedDC& dc, RealRect sym_rect, double font_size, const Alignment& align, SymbolInFont& sym, const String& text);
/// Draw the default bitmap to a dc and overlay a string of text
void drawWithText(RotatedDC& dc, const RealRect& rect, double font_size, const Alignment& align, const String& text);
/// Size of a single symbol /// Size of a single symbol
RealSize symbolSize (double font_size, const DrawableSymbol& sym); RealSize symbolSize (double font_size, const DrawableSymbol& sym);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment