質問編集履歴
6
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -54,28 +54,14 @@
|
|
54
54
|
|
55
55
|
face->glyph->advance.x 0
|
56
56
|
|
57
|
+
character H
|
58
|
+
|
57
59
|
pixelSize 30
|
58
60
|
|
59
61
|
|
60
62
|
|
61
63
|
|
62
64
|
|
63
|
-
|
64
|
-
|
65
|
-
face->glyph->bitmap.width 26
|
66
|
-
|
67
|
-
face->glyph->bitmap.rows 19
|
68
|
-
|
69
|
-
face->glyph->bitmap_left 0
|
70
|
-
|
71
|
-
face->glyph->bitmap_top 23
|
72
|
-
|
73
|
-
face->glyph->advance.x 1920
|
74
|
-
|
75
|
-
pixelSize 30
|
76
|
-
|
77
|
-
|
78
|
-
|
79
65
|
全て正常と思われる値が出ているため文字数の関係で割愛
|
80
66
|
|
81
67
|
```
|
5
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,6 +10,8 @@
|
|
10
10
|
|
11
11
|
face->glyph-> の値を確認フォーマット指定を確認
|
12
12
|
|
13
|
+
グリフの値をデバッグ
|
14
|
+
|
13
15
|
|
14
16
|
|
15
17
|
##### 利用ライブラリ
|
@@ -32,14 +34,54 @@
|
|
32
34
|
|
33
35
|
|
34
36
|
|
37
|
+
|
38
|
+
|
35
39
|
参考サイト:[https://learnopengl.com/In-Practice/Text-Rendering](https://learnopengl.com/In-Practice/Text-Rendering)
|
36
40
|
|
37
41
|

|
38
42
|
|
39
|
-
|
40
|
-
|
41
43
|
```
|
42
44
|
|
45
|
+
$ ./GL
|
46
|
+
|
47
|
+
face->glyph->bitmap.width 0
|
48
|
+
|
49
|
+
face->glyph->bitmap.rows 2
|
50
|
+
|
51
|
+
face->glyph->bitmap_left 0
|
52
|
+
|
53
|
+
face->glyph->bitmap_top 1
|
54
|
+
|
55
|
+
face->glyph->advance.x 0
|
56
|
+
|
57
|
+
pixelSize 30
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
face->glyph->bitmap.width 26
|
66
|
+
|
67
|
+
face->glyph->bitmap.rows 19
|
68
|
+
|
69
|
+
face->glyph->bitmap_left 0
|
70
|
+
|
71
|
+
face->glyph->bitmap_top 23
|
72
|
+
|
73
|
+
face->glyph->advance.x 1920
|
74
|
+
|
75
|
+
pixelSize 30
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
全て正常と思われる値が出ているため文字数の関係で割愛
|
80
|
+
|
81
|
+
```
|
82
|
+
|
83
|
+
```
|
84
|
+
|
43
85
|
#include "../header/Text.hpp"
|
44
86
|
|
45
87
|
|
@@ -226,6 +268,28 @@
|
|
226
268
|
|
227
269
|
|
228
270
|
|
271
|
+
|
272
|
+
|
273
|
+
printf("face->glyph->bitmap.width %ld\n",face->glyph->bitmap.width);
|
274
|
+
|
275
|
+
printf("face->glyph->bitmap.rows %ld\n",face->glyph->bitmap.rows);
|
276
|
+
|
277
|
+
printf("face->glyph->bitmap_left %ld\n",face->glyph->bitmap_left);
|
278
|
+
|
279
|
+
printf("face->glyph->bitmap_top %ld\n",face->glyph->bitmap_top);
|
280
|
+
|
281
|
+
printf("face->glyph->advance.x %ld\n",face->glyph->advance.x);
|
282
|
+
|
283
|
+
printf("character %c\n",*itr);
|
284
|
+
|
285
|
+
printf("pixelSize %ld\n",pixelSize);
|
286
|
+
|
287
|
+
printf("\n\n\n");
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
229
293
|
Character ch =
|
230
294
|
|
231
295
|
{
|
4
文章を修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,6 +28,12 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
参考サイト:[https://learnopengl.com/In-Practice/Text-Rendering](https://learnopengl.com/In-Practice/Text-Rendering)
|
36
|
+
|
31
37
|

|
32
38
|
|
33
39
|
|
3
文章を修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
フォントは正常に読み込めてます。
|
10
10
|
|
11
|
-
|
11
|
+
face->glyph-> の値を確認フォーマット指定を確認
|
12
12
|
|
13
13
|
|
14
14
|
|
2
文章を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -459,3 +459,139 @@
|
|
459
459
|
}
|
460
460
|
|
461
461
|
```
|
462
|
+
|
463
|
+
```
|
464
|
+
|
465
|
+
#ifndef ___TEXT_HPP_
|
466
|
+
|
467
|
+
#define ___TEXT_HPP_
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
#include <iostream>
|
472
|
+
|
473
|
+
#include <stdio.h>
|
474
|
+
|
475
|
+
#include <vector>
|
476
|
+
|
477
|
+
#include <stdarg.h>
|
478
|
+
|
479
|
+
#include <map>
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
#include <glm/glm.hpp>
|
484
|
+
|
485
|
+
#include <ft2build.h>
|
486
|
+
|
487
|
+
#include FT_FREETYPE_H
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
#include "Help.hpp"
|
492
|
+
|
493
|
+
#include "Render.hpp"
|
494
|
+
|
495
|
+
#include "VertexData.hpp"
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
/*#########################################################################
|
500
|
+
|
501
|
+
# 文字描画クラス
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
説明
|
506
|
+
|
507
|
+
文字を描画する
|
508
|
+
|
509
|
+
###########################################################################*/
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
namespace FrameWork
|
516
|
+
|
517
|
+
{
|
518
|
+
|
519
|
+
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
class Text : public FrameWork::Render_2D
|
524
|
+
|
525
|
+
{
|
526
|
+
|
527
|
+
private:
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
//文字 構造体
|
532
|
+
|
533
|
+
typedef struct
|
534
|
+
|
535
|
+
{
|
536
|
+
|
537
|
+
GLuint textureID; // グリフのテクスチャID
|
538
|
+
|
539
|
+
glm::lowp_u8vec2 size; // グリフサイズ
|
540
|
+
|
541
|
+
glm::lowp_u8vec2 bearing; // グリフのベースライン
|
542
|
+
|
543
|
+
unsigned short advance; // 次のグリフまでのオフセット
|
544
|
+
|
545
|
+
wchar_t character; // 文字
|
546
|
+
|
547
|
+
glm::lowp_u8vec4 color; // 描画色
|
548
|
+
|
549
|
+
byte pixelSize; // ピクセルサイズ
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
}Character;
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
public:
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
Text(); //コンストラクタ
|
562
|
+
|
563
|
+
~Text(); //デストラクタ
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
void setString(const byte pixelSize, const glm::lowp_u8vec4 color, const char* args,...);
|
568
|
+
|
569
|
+
void DrawString(glm::vec2 pos);
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
private:
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
std::vector<wchar_t> getWchar_t(const char* str);
|
578
|
+
|
579
|
+
void setTexture(const std::vector<wchar_t>& wc, std::vector<Character>& text, const glm::lowp_u8vec4 color, const byte pixelSize);
|
580
|
+
|
581
|
+
void RenderString(glm::vec2 pos);
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
std::vector<Character> text;
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
|
590
|
+
|
591
|
+
};
|
592
|
+
|
593
|
+
};
|
594
|
+
|
595
|
+
#endif
|
596
|
+
|
597
|
+
```
|
1
文章を修正しました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
freetype ライブラリ 描画される文字と描画されない文字がある理由が知りたい。
|
1
|
+
opengl freetype ライブラリ 描画される文字と描画されない文字がある理由が知りたい。
|
test
CHANGED
@@ -12,7 +12,19 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
|
15
|
+
##### 利用ライブラリ
|
16
|
+
|
17
|
+
opengl
|
18
|
+
|
19
|
+
glew
|
20
|
+
|
21
|
+
glfw
|
22
|
+
|
23
|
+
glm
|
24
|
+
|
25
|
+
freetype
|
26
|
+
|
27
|
+
stb
|
16
28
|
|
17
29
|
|
18
30
|
|