@@ -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);
@@ -418,7 +418,7 @@ void FT2Font::set_text(
418418 bbox.xMax = bbox.yMax = -32000 ;
419419
420420 FT_UInt previous = 0 ;
421- FT2Font *previous_ft_object = NULL ;
421+ FT2Font *previous_ft_object = nullptr ;
422422
423423 for (auto codepoint : text) {
424424 FT_UInt glyph_index = 0 ;
@@ -454,8 +454,8 @@ void FT2Font::set_text(
454454 FT_Glyph &thisGlyph = glyphs[glyphs.size () - 1 ];
455455
456456 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 );
459459 xys.push_back (pen.x );
460460 xys.push_back (pen.y );
461461
@@ -490,7 +490,7 @@ void FT2Font::load_char(long charcode, FT_Int32 flags, FT2Font *&ft_object, bool
490490 if (fallback && char_to_font.find (charcode) != char_to_font.end ()) {
491491 ft_object = char_to_font[charcode];
492492 // since it will be assigned to ft_object anyway
493- FT2Font *throwaway = NULL ;
493+ FT2Font *throwaway = nullptr ;
494494 ft_object->load_char (charcode, flags, throwaway, false );
495495 } else if (fallback) {
496496 FT_UInt final_glyph_index;
@@ -515,7 +515,7 @@ void FT2Font::load_char(long charcode, FT_Int32 flags, FT2Font *&ft_object, bool
515515 ft_object = this ;
516516 FT_UInt glyph_index = FT_Get_Char_Index (face, (FT_ULong) charcode);
517517 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 );
519519 ft_glyph_warn ((FT_ULong)charcode, glyph_seen_fonts);
520520 }
521521 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)
634634
635635FT_UInt FT2Font::get_char_index (FT_ULong charcode, bool fallback = false )
636636{
637- FT2Font *ft_object = NULL ;
637+ FT2Font *ft_object = nullptr ;
638638 if (fallback && char_to_font.find (charcode) != char_to_font.end ()) {
639639 // fallback denotes whether we want to search fallback list.
640640 // should call set_text/load_char_with_fallback to parent FT2Font before
@@ -674,7 +674,7 @@ void FT2Font::draw_glyphs_to_bitmap(bool antialiased)
674674
675675 for (auto & glyph : glyphs) {
676676 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 );
678678 if (error) {
679679 throw_ft_error (" Could not convert glyph to bitmap" , error);
680680 }
0 commit comments