gosu 0.14.4.pre2 → 0.14.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/Log.hpp +1 -1
- data/src/Texture.cpp +1 -1
- data/src/TrueTypeFontApple.cpp +4 -0
- data/src/TrueTypeFontUnix.cpp +2 -2
- data/src/TrueTypeFontWin.cpp +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2168ca402f81259d76387cd64599c6cdd1470a8ce699fb2b294b8e2e023098e6
|
4
|
+
data.tar.gz: d3984f99e712324d43ef8a17171b99b247179614367274bd10fa1bd4867ca019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5ae5debb624c82b30ee850d9eb0488099e4884239f1e836073d174179e80e95ad5dfe990c923734b7b13ede800da62418ca288dca90e591e830f960c105ae81
|
7
|
+
data.tar.gz: 2e30a324a79dc1a41ad21d6ed999bcbce5b0b585ba85cf3c74224f1be5de14ae114bc72725d40a69e7761447b1104b142cb6f2a1ac8a3fb5a418e6a9bc58f8b8
|
data/src/Log.hpp
CHANGED
data/src/Texture.cpp
CHANGED
@@ -15,7 +15,7 @@ namespace Gosu
|
|
15
15
|
Gosu::Texture::Texture(unsigned width, unsigned height, bool retro)
|
16
16
|
: allocator_(width, height), retro_(retro)
|
17
17
|
{
|
18
|
-
log("Allocating a new texture of size %dx%d (retro=%d)", width, height, (int) retro);
|
18
|
+
log("Allocating a new texture of size %dx%d (retro=%d)", width, height, (int) retro);
|
19
19
|
|
20
20
|
ensure_current_context();
|
21
21
|
|
data/src/TrueTypeFontApple.cpp
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
#if defined(GOSU_IS_MAC)
|
3
3
|
|
4
4
|
#include "TrueTypeFont.hpp"
|
5
|
+
#include "Log.hpp"
|
5
6
|
|
6
7
|
#include <Gosu/IO.hpp>
|
7
8
|
#include <Gosu/Text.hpp>
|
@@ -20,6 +21,8 @@ const unsigned char* Gosu::ttf_data_by_name(const string& font_name, unsigned fo
|
|
20
21
|
auto& ttf_ptr = ttf_file_cache[make_pair(font_name, font_flags)];
|
21
22
|
if (ttf_ptr) return ttf_ptr;
|
22
23
|
|
24
|
+
log("Trying to find a font named '%s', flags=%x", font_name.c_str(), font_flags);
|
25
|
+
|
23
26
|
unsigned symbolic_traits = 0;
|
24
27
|
if (font_flags & Gosu::FF_BOLD) symbolic_traits |= kCTFontBoldTrait;
|
25
28
|
if (font_flags & Gosu::FF_ITALIC) symbolic_traits |= kCTFontItalicTrait;
|
@@ -38,6 +41,7 @@ const unsigned char* Gosu::ttf_data_by_name(const string& font_name, unsigned fo
|
|
38
41
|
if (font) {
|
39
42
|
NSURL *url = CFBridgingRelease(CTFontCopyAttribute(font, kCTFontURLAttribute));
|
40
43
|
if (url && url.fileSystemRepresentation) {
|
44
|
+
log("Loading file '%s'", url.fileSystemRepresentation);
|
41
45
|
ttf_ptr = ttf_data_from_file(url.fileSystemRepresentation);
|
42
46
|
}
|
43
47
|
CFRelease(font);
|
data/src/TrueTypeFontUnix.cpp
CHANGED
@@ -96,8 +96,8 @@ static const unsigned char* ttf_data_of_default_sans_serif_font()
|
|
96
96
|
|
97
97
|
// At this point, we already have an open FcConfig, and can pass nullptr to these functions.
|
98
98
|
FcPattern* pattern = FcNameParse(reinterpret_cast<const FcChar8*>("sans-serif"));
|
99
|
-
FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
|
100
|
-
FcDefaultSubstitute(pattern);
|
99
|
+
FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
|
100
|
+
FcDefaultSubstitute(pattern);
|
101
101
|
FcResult match_result;
|
102
102
|
pattern = FcFontMatch(nullptr, pattern, &match_result);
|
103
103
|
if (match_result == FcResultMatch) {
|
data/src/TrueTypeFontWin.cpp
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
#if defined(GOSU_IS_WIN)
|
3
3
|
|
4
4
|
#include "TrueTypeFont.hpp"
|
5
|
+
#include "Log.hpp"
|
5
6
|
|
6
7
|
#define _WIN32_WINNT 0x0500
|
7
8
|
#include <windows.h>
|
@@ -26,6 +27,8 @@ const unsigned char* Gosu::ttf_data_by_name(const string& font_name, unsigned fo
|
|
26
27
|
auto& buffer_ptr = ttf_file_cache[make_pair(font_name, font_flags)];
|
27
28
|
if (buffer_ptr) return static_cast<const unsigned char*>(buffer_ptr->data());
|
28
29
|
|
30
|
+
log("Trying to find a font named '%s', flags=%x", font_name.c_str(), font_flags);
|
31
|
+
|
29
32
|
LOGFONT logfont = {
|
30
33
|
0, 0, 0, 0,
|
31
34
|
(font_flags & Gosu::FF_BOLD) ? FW_BOLD : FW_NORMAL,
|
@@ -51,6 +54,10 @@ const unsigned char* Gosu::ttf_data_by_name(const string& font_name, unsigned fo
|
|
51
54
|
auto data = static_cast<const unsigned char*>(buffer->data());
|
52
55
|
if (font_name.empty() || TrueTypeFont::matches(data, font_name, font_flags)) {
|
53
56
|
buffer_ptr = buffer;
|
57
|
+
log("Found a matching file (%d bytes)", (int) buffer->size());
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
log("Internal font name did not match; discarding result");
|
54
61
|
}
|
55
62
|
}
|
56
63
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gosu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.4
|
4
|
+
version: 0.14.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Raschke
|
@@ -163,9 +163,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: 1.9.3
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
|
-
- - "
|
166
|
+
- - ">="
|
167
167
|
- !ruby/object:Gem::Version
|
168
|
-
version:
|
168
|
+
version: '0'
|
169
169
|
requirements: []
|
170
170
|
rubyforge_project:
|
171
171
|
rubygems_version: 2.7.6
|