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
1f6decc4
Commit
1f6decc4
authored
Jul 04, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed curly quotes after parenthesis: ("
Font size is now independent of screen DPI, at least on windows
parent
b328b16d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
src/data/font.cpp
src/data/font.cpp
+13
-4
src/script/functions/basic.cpp
src/script/functions/basic.cpp
+2
-3
No files found.
src/data/font.cpp
View file @
1f6decc4
...
...
@@ -73,18 +73,27 @@ wxFont Font::toWxFont(double scale) const {
int
size_i
=
scale
*
size
;
int
weight_i
=
flags
&
FONT_BOLD
?
wxFONTWEIGHT_BOLD
:
wxFONTWEIGHT_NORMAL
;
int
style_i
=
flags
&
FONT_ITALIC
?
wxFONTSTYLE_ITALIC
:
wxFONTSTYLE_NORMAL
;
// make font
wxFont
font
;
if
(
flags
&
FONT_CODE
)
{
if
(
size_i
<
2
)
size_i
=
wxNORMAL_FONT
->
GetPointSize
();
return
wxFont
(
size_i
,
wxFONTFAMILY_TELETYPE
,
wxFONTSTYLE_NORMAL
,
weight_i
,
underline
(),
_
(
"Courier New"
));
font
=
wxFont
(
size_i
,
wxFONTFAMILY_TELETYPE
,
wxFONTSTYLE_NORMAL
,
weight_i
,
underline
(),
_
(
"Courier New"
));
}
else
if
(
name
().
empty
())
{
wxFont
font
=
*
wxNORMAL_FONT
;
font
=
*
wxNORMAL_FONT
;
font
.
SetPointSize
(
size
>
1
?
size_i
:
scale
*
font
.
GetPointSize
());
return
font
;
}
else
if
(
flags
&
FONT_ITALIC
&&
!
italic_name
().
empty
())
{
return
wxFont
(
size_i
,
wxFONTFAMILY_DEFAULT
,
wxFONTSTYLE_NORMAL
,
weight_i
,
underline
(),
italic_name
());
font
=
wxFont
(
size_i
,
wxFONTFAMILY_DEFAULT
,
wxFONTSTYLE_NORMAL
,
weight_i
,
underline
(),
italic_name
());
}
else
{
return
wxFont
(
size_i
,
wxFONTFAMILY_DEFAULT
,
style_i
,
weight_i
,
underline
(),
name
());
font
=
wxFont
(
size_i
,
wxFONTFAMILY_DEFAULT
,
style_i
,
weight_i
,
underline
(),
name
());
}
// fix size
#ifdef __WXMSW__
// make it independent of screen dpi, always use 96 dpi
// TODO: do something more sensible, and more portable
font
.
SetPixelSize
(
wxSize
(
0
,
-
(
int
)(
scale
*
size
*
96.0
/
72.0
+
0.5
)
));
#endif
return
font
;
}
IMPLEMENT_REFLECTION_NO_SCRIPT
(
Font
)
{
...
...
src/script/functions/basic.cpp
View file @
1f6decc4
...
...
@@ -101,14 +101,13 @@ SCRIPT_FUNCTION(curly_quotes) {
c
=
open
?
LEFT_SINGLE_QUOTE
:
RIGHT_SINGLE_QUOTE
;
}
else
if
(
c
==
_
(
'\"'
)
||
c
==
LEFT_DOUBLE_QUOTE
||
c
==
RIGHT_DOUBLE_QUOTE
)
{
c
=
open
?
LEFT_DOUBLE_QUOTE
:
RIGHT_DOUBLE_QUOTE
;
}
if
(
c
==
_
(
'<'
))
{
}
else
if
(
c
==
_
(
'<'
))
{
in_tag
=
true
;
}
else
if
(
c
==
_
(
'>'
))
{
in_tag
=
false
;
}
else
if
(
!
in_tag
)
{
// Also allow double-nesting of quotes
open
=
isSpace
(
c
)
||
c
==
LEFT_DOUBLE_QUOTE
||
c
==
LEFT_SINGLE_QUOTE
;
open
=
isSpace
(
c
)
||
c
==
_
(
'('
)
||
c
==
_
(
'['
)
;
}
}
SCRIPT_RETURN
(
input
);
...
...
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