# File lib/pdf/writer.rb, line 1060
1060:   def current_font!
1061:     select_font("Helvetica") unless @current_base_font
1062: 
1063:     font = File.basename(@current_base_font)
1064:     if @font_families[font] and @font_families[font][@current_text_state]
1065:         # Then we are in some state or another and this font has a family,
1066:         # and the current setting exists within it select the font, then
1067:         # return it.
1068:       if File.dirname(@current_base_font) != '.'
1069:         nf = File.join(File.dirname(@current_base_font), @font_families[font][@current_text_state])
1070:       else
1071:         nf = @font_families[font][@current_text_state]
1072:       end
1073: 
1074:       unless @fonts[nf]
1075:         enc = {
1076:           :encoding     => @fonts[font].encoding,
1077:           :differences  => @fonts[font].differences
1078:         }
1079:         load_font(nf, enc)
1080:       end
1081:       @current_font = nf
1082:     else
1083:       @current_font = @current_base_font
1084:     end
1085:   end