Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit 1c2d833

Browse filesBrowse files
Merge pull request livecode#7593 from livecodepanos/merge-develop-9.6-16_7_2021
Merge develop 9.6 16 7 2021
2 parents 713311c + 7a0292b commit 1c2d833
Copy full SHA for 1c2d833

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

41 files changed

+1287
-792
lines changed

‎builder/builder_utilities.livecodescript

Copy file name to clipboardExpand all lines: builder/builder_utilities.livecodescript
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
script "BuilderUtilities"
22

3-
constant kMergExtVersion = "2021-2-2"
4-
constant kTSNetVersion = "1.4.4"
3+
constant kMergExtVersion = "2021-6-16"
4+
constant kTSNetVersion = "1.4.5"
55

66
local sEngineDir
77
local sWorkDir

‎docs/dictionary/command/post.lcdoc

Copy file name to clipboardExpand all lines: docs/dictionary/command/post.lcdoc
+1-9Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Associations: internet library
1111

1212
Introduced: 1.0
1313

14-
OS: mac, windows, linux, ios, android, html5
14+
OS: mac, windows, linux, ios, android
1515

1616
Platforms: desktop, server, mobile
1717

@@ -104,14 +104,6 @@ password "pass", use the following <statement> :
104104
> <URLEncode> any username and password fields appropriately for FTP
105105
> URLs.
106106

107-
> *Cross-platform note:* The HTML5 engine only supports HTTP and HTTPs
108-
> protocols.
109-
110-
> *Cross-platform note:* URLs fetched by the HTML5 engine from a domain
111-
> other than that of the hosting the page may be blocked by web browsers,
112-
> unless the server hosting the URL sets the "Access-Control-Origin" header
113-
> appropriately.
114-
115107
References: post (command), write to socket (command),
116108
delete URL (command), read from socket (command), put (command),
117109
libURLSetExpect100 (command), libURLSetLogField (command),

‎docs/notes/bugfix-21615.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Add HiDPI scaling support to HTML5 engine

‎docs/notes/bugfix-22791.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix codesigning error saving Mac standalone app when the app name contains accented characters

‎docs/notes/bugfix-22868.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ensure format() function recognizes a negative format length

‎docs/notes/bugfix-23016.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix 'fontnames' always returning empty in HTML5 standalones

‎docs/notes/bugfix-23044.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix crash when deleting the current card of a stack within its closeStack handler

‎docs/notes/bugfix-23168.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix memory leak when rendering gradients where the quality is set to "good"

‎docs/notes/bugfix-23240.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix IDE lockup when an execution error occurs in a modal stack

‎docs/notes/bugfix-23247.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Removed all references to HTML5 from the post entry.

‎engine/engine-sources.gypi

Copy file name to clipboardExpand all lines: engine/engine-sources.gypi
+22-4Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
'src/bitmapeffectblur.h',
1111
'src/color.h',
1212
'src/context.h',
13+
'src/customfont.h',
1314
'src/font.h',
15+
'src/freetype-font.h',
1416
'src/gradient.h',
1517
'src/graphics_util.h',
1618
'src/graphicscontext.h',
@@ -23,15 +25,18 @@
2325
'src/redraw.h',
2426
'src/region.h',
2527
'src/resolution.h',
28+
'src/skiatypeface.h',
2629
'src/textlayout.h',
2730
'src/tilecache.h',
2831
'src/bitmapeffect.cpp',
2932
'src/bitmapeffectblur.cpp',
3033
'src/color.cpp',
3134
'src/combiners.cpp',
35+
'src/customfont.cpp',
3236
'src/customprinter.cpp',
3337
'src/font.cpp',
3438
'src/fonttable.cpp',
39+
'src/freetype-font.cpp',
3540
'src/glcontext.cpp',
3641
'src/glcontext.h',
3742
'src/gradient.cpp',
@@ -46,14 +51,13 @@
4651
'src/region.cpp',
4752
'src/resolution.cpp',
4853
'src/rgb.cpp',
54+
'src/skiatypeface.cpp',
4955
'src/surface.cpp',
5056
'src/tilecache.cpp',
5157
'src/tilecachecg.cpp',
5258
'src/tilecachegl.cpp',
5359
'src/tilecachegl3.x.cpp',
5460
'src/tilecachesw.cpp',
55-
'src/mcsemaphore.h',
56-
'src/mctristate.h',
5761

5862
# Group "Core - Language"
5963
'src/ans.h',
@@ -132,8 +136,10 @@
132136
'src/license.cpp',
133137
'src/mcerror.h',
134138
'src/mcio.h',
139+
'src/mcsemaphore.h',
135140
'src/mcssl.h',
136141
'src/mcstring.h',
142+
'src/mctristate.h',
137143
'src/mcutility.h',
138144
'src/md5.h',
139145
'src/meta.h',
@@ -429,7 +435,6 @@
429435
'src/mblandroid.h',
430436
'src/mblandroidcontrol.h',
431437
'src/mblandroidjava.h',
432-
'src/mblandroidtypeface.h',
433438
'src/mblandroidutil.h',
434439
'src/mblandroid.cpp',
435440
'src/mblandroidbrowser.cpp',
@@ -463,7 +468,6 @@
463468
'src/mblandroidsound.cpp',
464469
'src/mblandroidtextlayout.cpp',
465470
'src/mblandroidtextmessaging.cpp',
466-
'src/mblandroidtypeface.cpp',
467471
'src/mblandroidurl.cpp',
468472

469473
# Group "Mobile - iOS"
@@ -775,6 +779,8 @@
775779
'src/em-event.js',
776780
'src/em-filehandle.h',
777781
'src/em-filehandle.cpp',
782+
'src/em-font.h',
783+
'src/em-font.cpp',
778784
'src/em-fontlist.h',
779785
'src/em-fontlist.cpp',
780786
'src/em-javascript.h',
@@ -1204,6 +1210,18 @@
12041210
],
12051211
},
12061212
],
1213+
# Exclude freetype / skia font handling code used by Android & Emscripten
1214+
[
1215+
'OS != "android" and OS != "emscripten"',
1216+
{
1217+
'sources!':
1218+
[
1219+
'src/customfont.cpp',
1220+
'src/freetype-font.cpp',
1221+
'src/skiatypeface.cpp',
1222+
],
1223+
},
1224+
],
12071225
[
12081226
'OS == "linux"',
12091227
{

‎engine/kernel.gyp

Copy file name to clipboardExpand all lines: engine/kernel.gyp
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
'dependencies':
111111
[
112112
'../prebuilt/thirdparty.gyp:thirdparty_prebuilt_skia',
113+
'../prebuilt/thirdparty.gyp:thirdparty_prebuilt_freetype',
113114
],
114115
},
115116
],

‎engine/rsrc/Installer-Info.plist

Copy file name to clipboardExpand all lines: engine/rsrc/Installer-Info.plist
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
6-
<string>English</string>
6+
<string>en</string>
77
<key>CFBundleExecutable</key>
88
<string>$(PRODUCT_NAME)</string>
99
<key>CFBundleGetInfoString</key>

‎engine/rsrc/LiveCode-Info.plist

Copy file name to clipboardExpand all lines: engine/rsrc/LiveCode-Info.plist
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
6-
<string>English</string>
6+
<string>en</string>
77
<key>CFBundleDocumentTypes</key>
88
<array>
99
<dict>

‎engine/rsrc/Standalone-Info.plist

Copy file name to clipboardExpand all lines: engine/rsrc/Standalone-Info.plist
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
6-
<string>English</string>
6+
<string>en</string>
77
<key>CFBundleDocumentTypes</key>
88
<array>
99
<dict>

‎engine/src/customfont.cpp

Copy file name to clipboard
+195Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
/* Copyright (C) 2020 LiveCode Ltd.
2+
3+
This file is part of LiveCode.
4+
5+
LiveCode is free software; you can redistribute it and/or modify it under
6+
the terms of the GNU General Public License v3 as published by the Free
7+
Software Foundation.
8+
9+
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
10+
WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
16+
17+
#include <foundation.h>
18+
#include <foundation-auto.h>
19+
20+
#include "customfont.h"
21+
22+
static MCCustomFont *s_custom_font_list = nil;
23+
24+
bool MCCustomFontListInitialize()
25+
{
26+
s_custom_font_list = nil;
27+
28+
return true;
29+
}
30+
31+
void MCCustomFontListFinalize()
32+
{
33+
for (MCCustomFont *t_font = s_custom_font_list; t_font != nil; )
34+
{
35+
MCCustomFont *t_next_font;
36+
t_next_font = t_font->next;
37+
MCCustomFontDelete(t_font);
38+
t_font = t_next_font;
39+
}
40+
s_custom_font_list = nil;
41+
}
42+
43+
bool MCCustomFontCreate(MCStringRef p_path, MCStringRef p_name, MCStringRef p_family, MCCustomFontStyle p_style, MCCustomFont* &r_font)
44+
{
45+
if (!MCMemoryNew(r_font))
46+
return false;
47+
48+
r_font->path = MCValueRetain(p_path);
49+
r_font->name = MCValueRetain(p_name);
50+
r_font->family = MCValueRetain(p_family);
51+
r_font->style = p_style;
52+
53+
r_font->next = nil;
54+
55+
return true;
56+
}
57+
58+
void MCCustomFontDelete(MCCustomFont *p_font)
59+
{
60+
if (p_font != nil)
61+
{
62+
MCValueRelease(p_font->path);
63+
MCValueRelease(p_font->name);
64+
MCValueRelease(p_font->family);
65+
MCMemoryDelete(p_font);
66+
}
67+
}
68+
69+
void MCCustomFontListAddFont(MCCustomFont *p_font)
70+
{
71+
if (s_custom_font_list == nil)
72+
s_custom_font_list = p_font;
73+
else
74+
{
75+
MCCustomFont *t_font = s_custom_font_list;
76+
while (t_font->next != nil)
77+
t_font = t_font->next;
78+
t_font->next = p_font;
79+
}
80+
p_font->next = nil;
81+
}
82+
83+
bool MCCustomFontListGetNames(MCStringRef& r_names)
84+
{
85+
bool t_success;
86+
t_success = true;
87+
88+
MCAutoListRef t_list;
89+
if (!MCListCreateMutable('\n', &t_list))
90+
return false;
91+
92+
for (MCCustomFont *t_font = s_custom_font_list; t_success && t_font != nil; t_font = t_font->next)
93+
t_success = MCListAppend(*t_list, t_font->name);
94+
95+
if (t_success)
96+
return MCListCopyAsString(*t_list, r_names);
97+
98+
return false;
99+
}
100+
101+
bool MCCustomFontListLookupFontByName(MCStringRef p_name, MCCustomFont* &r_font)
102+
{
103+
for (MCCustomFont *t_font = s_custom_font_list; t_font != nil; t_font = t_font->next)
104+
{
105+
if (MCStringIsEqualTo(p_name, t_font->name, kMCStringOptionCompareCaseless))
106+
{
107+
r_font = t_font;
108+
return true;
109+
}
110+
}
111+
112+
return false;
113+
}
114+
115+
bool MCCustomFontListLookupFontByFamilyAndStyle(MCStringRef p_family, bool p_bold, bool p_italic, MCCustomFont* &r_font)
116+
{
117+
MCCustomFont *t_closest_font;
118+
t_closest_font = nil;
119+
for (MCCustomFont *t_font = s_custom_font_list; t_font != nil; t_font = t_font->next)
120+
{
121+
if (MCStringIsEqualTo(p_family, t_font->family, kMCStringOptionCompareCaseless))
122+
{
123+
if ((p_bold && p_italic && t_font->style == kMCCustomFontStyleBoldItalic) ||
124+
(p_bold && t_font->style == kMCCustomFontStyleBold) ||
125+
(p_italic && t_font->style == kMCCustomFontStyleItalic))
126+
{
127+
r_font = t_font;
128+
return true;
129+
}
130+
else if (t_closest_font == nil)
131+
t_closest_font = t_font;
132+
}
133+
}
134+
135+
if (t_closest_font != nil)
136+
{
137+
r_font = t_closest_font;
138+
return true;
139+
}
140+
141+
return false;
142+
}
143+
144+
bool MCCustomFontListLookupFont(MCStringRef p_name, bool p_bold, bool p_italic, MCCustomFont* &r_font)
145+
{
146+
MCAutoStringRef t_styled_name;
147+
if (!MCStringMutableCopy(p_name, &t_styled_name))
148+
return false;
149+
if (p_bold && !MCStringAppend(*t_styled_name, MCSTR(" Bold")))
150+
return false;
151+
if (p_italic && !MCStringAppend(*t_styled_name, MCSTR(" Italic")))
152+
return false;
153+
154+
// First of all, attempt to look the font up by taking into account its name and style.
155+
// e.g. textFont:Arial textStyle:Bold - look for a font named Arial Bold.
156+
// This will fail for textFonts which include style information e.g. textFont:Arial textStyle:Bold will search for Arial Bold Bold
157+
if (MCCustomFontListLookupFontByName(*t_styled_name, r_font))
158+
return true;
159+
160+
// If no font found, look up based purely on the name. This will solve cases where style
161+
// information is included in the name e.g. Arial Bold.
162+
if (p_bold || p_italic)
163+
{
164+
if (MCCustomFontListLookupFontByName(p_name, r_font))
165+
return true;
166+
}
167+
168+
// If we've still not found a matching font, look up based on the family and style.
169+
// This function will attempt to provide a closest match e.g. Arial Bold is requested but only Arial is installed.
170+
if (MCCustomFontListLookupFontByFamilyAndStyle(p_name, p_bold, p_italic, r_font))
171+
return true;
172+
173+
return false;
174+
}
175+
176+
MCCustomFontStyle MCCustomFontListGetStylesForName(MCStringRef p_name)
177+
{
178+
MCCustomFontStyle t_styles;
179+
t_styles = 0;
180+
181+
for (MCCustomFont *t_font = s_custom_font_list; t_font != nil; t_font = t_font->next)
182+
{
183+
if (MCStringIsEqualTo(p_name, t_font->family, kMCStringOptionCompareCaseless))
184+
t_styles |= t_font->style;
185+
}
186+
187+
if (t_styles == 0)
188+
{
189+
MCCustomFont *t_font = nil;
190+
if (MCCustomFontListLookupFontByName(p_name, t_font))
191+
t_styles |= t_font->style;
192+
}
193+
194+
return t_styles;
195+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.