@@ -63,12 +63,12 @@ void throw_ft_error(std::string message, FT_Error error) {
6363 throw std::runtime_error (os.str ());
6464}
6565
66- FT2Image::FT2Image () : m_buffer (NULL ), m_width (0 ), m_height (0 )
66+ FT2Image::FT2Image () : m_buffer (nullptr ), m_width (0 ), m_height (0 )
6767{
6868}
6969
7070FT2Image::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 )
7272{
7373 resize (width, height);
7474}
@@ -91,7 +91,7 @@ void FT2Image::resize(long width, long height)
9191 if ((unsigned long )width != m_width || (unsigned long )height != m_height) {
9292 if (numBytes > m_width * m_height) {
9393 delete[] m_buffer;
94- m_buffer = NULL ;
94+ m_buffer = nullptr ;
9595 m_buffer = new unsigned char [numBytes];
9696 }
9797
@@ -259,7 +259,7 @@ FT2Font::FT2Font(FT_Open_Args &open_args,
259259 long hinting_factor_,
260260 std::vector<FT2Font *> &fallback_list,
261261 FT2Font::WarnFunc warn)
262- : ft_glyph_warn (warn), image (), face (NULL )
262+ : ft_glyph_warn (warn), image (), face (nullptr )
263263{
264264 clear ();
265265
@@ -280,12 +280,12 @@ FT2Font::FT2Font(FT_Open_Args &open_args,
280280 throw_ft_error (" Could not set the fontsize" , error);
281281 }
282282
283- if (open_args.stream != NULL ) {
283+ if (open_args.stream != nullptr ) {
284284 face->face_flags |= FT_FACE_FLAG_EXTERNAL_STREAM;
285285 }
286286
287287 FT_Matrix transform = { 65536 / hinting_factor, 0 , 0 , 65536 };
288- FT_Set_Transform (face, &transform, 0 );
288+ FT_Set_Transform (face, &transform, nullptr );
289289
290290 // Set fallbacks
291291 std::copy (fallback_list.begin (), fallback_list.end (), std::back_inserter (fallbacks));
@@ -329,7 +329,7 @@ void FT2Font::set_size(double ptsize, double dpi)
329329 throw_ft_error (" Could not set the fontsize" , error);
330330 }
331331 FT_Matrix transform = { 65536 / hinting_factor, 0 , 0 , 65536 };
332- FT_Set_Transform (face, &transform, 0 );
332+ FT_Set_Transform (face, &transform, nullptr );
333333
334334 for (auto & fallback : fallbacks) {
335335 fallback->set_size (ptsize, dpi);
@@ -420,7 +420,7 @@ void FT2Font::set_text(
420420 bbox.xMax = bbox.yMax = -32000 ;
421421
422422 FT_UInt previous = 0 ;
423- FT2Font *previous_ft_object = NULL ;
423+ FT2Font *previous_ft_object = nullptr ;
424424
425425 for (auto codepoint : text) {
426426 FT_UInt glyph_index = 0 ;
@@ -456,8 +456,8 @@ void FT2Font::set_text(
456456 FT_Glyph &thisGlyph = glyphs[glyphs.size () - 1 ];
457457
458458 last_advance = ft_object_with_glyph->get_face ()->glyph ->advance .x ;
459- FT_Glyph_Transform (thisGlyph, 0 , &pen);
460- FT_Glyph_Transform (thisGlyph, &matrix, 0 );
459+ FT_Glyph_Transform (thisGlyph, nullptr , &pen);
460+ FT_Glyph_Transform (thisGlyph, &matrix, nullptr );
461461 xys.push_back (pen.x );
462462 xys.push_back (pen.y );
463463
@@ -492,7 +492,7 @@ void FT2Font::load_char(long charcode, FT_Int32 flags, FT2Font *&ft_object, bool
492492 if (fallback && char_to_font.find (charcode) != char_to_font.end ()) {
493493 ft_object = char_to_font[charcode];
494494 // since it will be assigned to ft_object anyway
495- FT2Font *throwaway = NULL ;
495+ FT2Font *throwaway = nullptr ;
496496 ft_object->load_char (charcode, flags, throwaway, false );
497497 } else if (fallback) {
498498 FT_UInt final_glyph_index;
@@ -517,7 +517,7 @@ void FT2Font::load_char(long charcode, FT_Int32 flags, FT2Font *&ft_object, bool
517517 ft_object = this ;
518518 FT_UInt glyph_index = FT_Get_Char_Index (face, (FT_ULong) charcode);
519519 if (!glyph_index){
520- glyph_seen_fonts.insert ((face != NULL )?face->family_name : NULL );
520+ glyph_seen_fonts.insert ((face != nullptr )?face->family_name : nullptr );
521521 ft_glyph_warn ((FT_ULong)charcode, glyph_seen_fonts);
522522 }
523523 if (FT_Error error = FT_Load_Glyph (face, glyph_index, flags)) {
@@ -636,7 +636,7 @@ void FT2Font::load_glyph(FT_UInt glyph_index, FT_Int32 flags)
636636
637637FT_UInt FT2Font::get_char_index (FT_ULong charcode, bool fallback = false )
638638{
639- FT2Font *ft_object = NULL ;
639+ FT2Font *ft_object = nullptr ;
640640 if (fallback && char_to_font.find (charcode) != char_to_font.end ()) {
641641 // fallback denotes whether we want to search fallback list.
642642 // should call set_text/load_char_with_fallback to parent FT2Font before
@@ -676,7 +676,7 @@ void FT2Font::draw_glyphs_to_bitmap(bool antialiased)
676676
677677 for (auto & glyph : glyphs) {
678678 FT_Error error = FT_Glyph_To_Bitmap (
679- &glyph, antialiased ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, 0 , 1 );
679+ &glyph, antialiased ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, nullptr , 1 );
680680 if (error) {
681681 throw_ft_error (" Could not convert glyph to bitmap" , error);
682682 }
0 commit comments