@@ -63,12 +63,12 @@ void throw_ft_error(std::string message, FT_Error error) {
63
63
throw std::runtime_error (os.str ());
64
64
}
65
65
66
- FT2Image::FT2Image () : m_buffer (NULL ), m_width (0 ), m_height (0 )
66
+ FT2Image::FT2Image () : m_buffer (nullptr ), m_width (0 ), m_height (0 )
67
67
{
68
68
}
69
69
70
70
FT2Image::FT2Image (unsigned long width, unsigned long height)
71
- : m_buffer (NULL ), m_width (0 ), m_height (0 )
71
+ : m_buffer (nullptr ), m_width (0 ), m_height (0 )
72
72
{
73
73
resize (width, height);
74
74
}
@@ -91,7 +91,7 @@ void FT2Image::resize(long width, long height)
91
91
if ((unsigned long )width != m_width || (unsigned long )height != m_height) {
92
92
if (numBytes > m_width * m_height) {
93
93
delete[] m_buffer;
94
- m_buffer = NULL ;
94
+ m_buffer = nullptr ;
95
95
m_buffer = new unsigned char [numBytes];
96
96
}
97
97
@@ -259,7 +259,7 @@ FT2Font::FT2Font(FT_Open_Args &open_args,
259
259
long hinting_factor_,
260
260
std::vector<FT2Font *> &fallback_list,
261
261
FT2Font::WarnFunc warn)
262
- : ft_glyph_warn (warn), image (), face (NULL )
262
+ : ft_glyph_warn (warn), image (), face (nullptr )
263
263
{
264
264
clear ();
265
265
@@ -280,12 +280,12 @@ FT2Font::FT2Font(FT_Open_Args &open_args,
280
280
throw_ft_error (" Could not set the fontsize" , error);
281
281
}
282
282
283
- if (open_args.stream != NULL ) {
283
+ if (open_args.stream != nullptr ) {
284
284
face->face_flags |= FT_FACE_FLAG_EXTERNAL_STREAM;
285
285
}
286
286
287
287
FT_Matrix transform = { 65536 / hinting_factor, 0 , 0 , 65536 };
288
- FT_Set_Transform (face, &transform, 0 );
288
+ FT_Set_Transform (face, &transform, nullptr );
289
289
290
290
// Set fallbacks
291
291
std::copy (fallback_list.begin (), fallback_list.end (), std::back_inserter (fallbacks));
@@ -329,7 +329,7 @@ void FT2Font::set_size(double ptsize, double dpi)
329
329
throw_ft_error (" Could not set the fontsize" , error);
330
330
}
331
331
FT_Matrix transform = { 65536 / hinting_factor, 0 , 0 , 65536 };
332
- FT_Set_Transform (face, &transform, 0 );
332
+ FT_Set_Transform (face, &transform, nullptr );
333
333
334
334
for (auto & fallback : fallbacks) {
335
335
fallback->set_size (ptsize, dpi);
@@ -418,7 +418,7 @@ void FT2Font::set_text(
418
418
bbox.xMax = bbox.yMax = -32000 ;
419
419
420
420
FT_UInt previous = 0 ;
421
- FT2Font *previous_ft_object = NULL ;
421
+ FT2Font *previous_ft_object = nullptr ;
422
422
423
423
for (auto codepoint : text) {
424
424
FT_UInt glyph_index = 0 ;
@@ -454,8 +454,8 @@ void FT2Font::set_text(
454
454
FT_Glyph &thisGlyph = glyphs[glyphs.size () - 1 ];
455
455
456
456
last_advance = ft_object_with_glyph->get_face ()->glyph ->advance .x ;
457
- FT_Glyph_Transform (thisGlyph, 0 , &pen);
458
- FT_Glyph_Transform (thisGlyph, &matrix, 0 );
457
+ FT_Glyph_Transform (thisGlyph, nullptr , &pen);
458
+ FT_Glyph_Transform (thisGlyph, &matrix, nullptr );
459
459
xys.push_back (pen.x );
460
460
xys.push_back (pen.y );
461
461
@@ -490,7 +490,7 @@ void FT2Font::load_char(long charcode, FT_Int32 flags, FT2Font *&ft_object, bool
490
490
if (fallback && char_to_font.find (charcode) != char_to_font.end ()) {
491
491
ft_object = char_to_font[charcode];
492
492
// since it will be assigned to ft_object anyway
493
- FT2Font *throwaway = NULL ;
493
+ FT2Font *throwaway = nullptr ;
494
494
ft_object->load_char (charcode, flags, throwaway, false );
495
495
} else if (fallback) {
496
496
FT_UInt final_glyph_index;
@@ -515,7 +515,7 @@ void FT2Font::load_char(long charcode, FT_Int32 flags, FT2Font *&ft_object, bool
515
515
ft_object = this ;
516
516
FT_UInt glyph_index = FT_Get_Char_Index (face, (FT_ULong) charcode);
517
517
if (!glyph_index){
518
- glyph_seen_fonts.insert ((face != NULL )?face->family_name : NULL );
518
+ glyph_seen_fonts.insert ((face != nullptr )?face->family_name : nullptr );
519
519
ft_glyph_warn ((FT_ULong)charcode, glyph_seen_fonts);
520
520
}
521
521
if (FT_Error error = FT_Load_Glyph (face, glyph_index, flags)) {
@@ -634,7 +634,7 @@ void FT2Font::load_glyph(FT_UInt glyph_index, FT_Int32 flags)
634
634
635
635
FT_UInt FT2Font::get_char_index (FT_ULong charcode, bool fallback = false )
636
636
{
637
- FT2Font *ft_object = NULL ;
637
+ FT2Font *ft_object = nullptr ;
638
638
if (fallback && char_to_font.find (charcode) != char_to_font.end ()) {
639
639
// fallback denotes whether we want to search fallback list.
640
640
// should call set_text/load_char_with_fallback to parent FT2Font before
@@ -674,7 +674,7 @@ void FT2Font::draw_glyphs_to_bitmap(bool antialiased)
674
674
675
675
for (auto & glyph : glyphs) {
676
676
FT_Error error = FT_Glyph_To_Bitmap (
677
- &glyph, antialiased ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, 0 , 1 );
677
+ &glyph, antialiased ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, nullptr , 1 );
678
678
if (error) {
679
679
throw_ft_error (" Could not convert glyph to bitmap" , error);
680
680
}
0 commit comments