Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
415e5ebc
Commit
415e5ebc
authored
Apr 19, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented "direction:vertical" support, also for symbols
parent
bc8b7dcd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
5 deletions
+14
-5
src/data/symbol_font.cpp
src/data/symbol_font.cpp
+4
-1
src/gui/print_window.cpp
src/gui/print_window.cpp
+1
-1
src/render/text/element.hpp
src/render/text/element.hpp
+3
-2
src/render/text/font.cpp
src/render/text/font.cpp
+1
-1
src/render/text/viewer.cpp
src/render/text/viewer.cpp
+5
-0
No files found.
src/data/symbol_font.cpp
View file @
415e5ebc
...
@@ -297,7 +297,10 @@ void SymbolFont::getCharInfo(RotatedDC& dc, Context& ctx, double font_size, cons
...
@@ -297,7 +297,10 @@ void SymbolFont::getCharInfo(RotatedDC& dc, Context& ctx, double font_size, cons
FOR_EACH_CONST
(
sym
,
text
)
{
FOR_EACH_CONST
(
sym
,
text
)
{
size_t
count
=
sym
.
text
.
size
();
size_t
count
=
sym
.
text
.
size
();
RealSize
size
=
dc
.
trInvS
(
symbolSize
(
ctx
,
dc
.
trS
(
font_size
),
sym
));
RealSize
size
=
dc
.
trInvS
(
symbolSize
(
ctx
,
dc
.
trS
(
font_size
),
sym
));
out
.
insert
(
out
.
end
(),
count
,
RealSize
(
size
.
width
/
count
,
size
.
height
));
// divide into count parts
size
.
width
/=
count
;
// divide into count parts
for
(
size_t
i
=
0
;
i
<
count
;
++
i
)
{
out
.
push_back
(
CharInfo
(
size
,
i
==
count
-
1
?
BREAK_MAYBE
:
BREAK_NO
));
}
}
}
}
}
...
...
src/gui/print_window.cpp
View file @
415e5ebc
...
@@ -120,7 +120,7 @@ class CardsPrintout : wxPrintout {
...
@@ -120,7 +120,7 @@ class CardsPrintout : wxPrintout {
PageLayout
layout
;
PageLayout
layout
;
/// Draw a card, that is card_nr on this page, find the postion by asking the layout
/// Draw a card, that is card_nr on this page, find the postion by asking the layout
void
drawCard
(
DC
&
dc
,
const
CardP
&
card
,
UIn
t
card_nr
);
void
drawCard
(
DC
&
dc
,
const
CardP
&
card
,
size_
t
card_nr
);
/// Draw a card at the specified coordinates
/// Draw a card at the specified coordinates
void
drawCard
(
DC
&
dc
,
const
CardP
&
card
,
double
x
,
double
y
,
int
rotation
=
0
);
void
drawCard
(
DC
&
dc
,
const
CardP
&
card
,
double
x
,
double
y
,
int
rotation
=
0
);
};
};
...
...
src/render/text/element.hpp
View file @
415e5ebc
...
@@ -31,7 +31,8 @@ enum DrawWhat
...
@@ -31,7 +31,8 @@ enum DrawWhat
/// Information on a linebreak
/// Information on a linebreak
enum
LineBreak
enum
LineBreak
{
BREAK_NO
// no line break
{
BREAK_NO
// no line break ever
,
BREAK_MAYBE
// break here when in "direction:vertical" mode
,
BREAK_SOFT
// optional line break (' ')
,
BREAK_SOFT
// optional line break (' ')
,
BREAK_HARD
// always a line break ('\n')
,
BREAK_HARD
// always a line break ('\n')
,
BREAK_LINE
// line break with a separator line (<line>)
,
BREAK_LINE
// line break with a separator line (<line>)
...
@@ -42,7 +43,7 @@ struct CharInfo {
...
@@ -42,7 +43,7 @@ struct CharInfo {
RealSize
size
;
RealSize
size
;
LineBreak
break_after
;
LineBreak
break_after
;
inline
CharInfo
(
RealSize
size
,
LineBreak
break_after
=
BREAK_NO
)
:
size
(
size
),
break_after
(
break_after
)
{}
inline
CharInfo
(
RealSize
size
,
LineBreak
break_after
)
:
size
(
size
),
break_after
(
break_after
)
{}
};
};
/// A section of text that can be rendered using a TextViewer
/// A section of text that can be rendered using a TextViewer
...
...
src/render/text/font.cpp
View file @
415e5ebc
...
@@ -38,7 +38,7 @@ void FontTextElement::getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>&
...
@@ -38,7 +38,7 @@ void FontTextElement::getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>&
RealSize
s
=
dc
.
GetTextExtent
(
content
.
substr
(
start
-
this
->
start
,
i
-
start
+
1
));
RealSize
s
=
dc
.
GetTextExtent
(
content
.
substr
(
start
-
this
->
start
,
i
-
start
+
1
));
out
.
push_back
(
CharInfo
(
RealSize
(
s
.
width
-
prev_width
,
s
.
height
),
out
.
push_back
(
CharInfo
(
RealSize
(
s
.
width
-
prev_width
,
s
.
height
),
c
==
_
(
'\n'
)
?
break_style
:
c
==
_
(
'\n'
)
?
break_style
:
c
==
_
(
' '
)
?
BREAK_SOFT
:
BREAK_
NO
c
==
_
(
' '
)
?
BREAK_SOFT
:
BREAK_
MAYBE
));
));
prev_width
=
s
.
width
;
prev_width
=
s
.
width
;
}
}
...
...
src/render/text/viewer.cpp
View file @
415e5ebc
...
@@ -410,6 +410,11 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
...
@@ -410,6 +410,11 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
}
else
if
(
c
.
break_after
==
BREAK_SOFT
&&
style
.
field
().
multi_line
)
{
}
else
if
(
c
.
break_after
==
BREAK_SOFT
&&
style
.
field
().
multi_line
)
{
// Soft break == end of word
// Soft break == end of word
accept_word
=
true
;
accept_word
=
true
;
}
else
if
(
c
.
break_after
==
BREAK_MAYBE
&&
style
.
direction
==
TOP_TO_BOTTOM
)
{
break_now
=
true
;
accept_word
=
true
;
hide_breaker
=
false
;
line_height_multiplier
=
style
.
line_height_soft
;
}
}
// Add size of the character
// Add size of the character
word_size
=
add_horizontal
(
word_size
,
c
.
size
);
word_size
=
add_horizontal
(
word_size
,
c
.
size
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment