diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c0b54737..09095197b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,7 @@ Now you can use OTF fonts in your documents. ### Fixed `character_spacing` effect on text width calculation Extra spacing was applied to the end of string which resulted in visually -incorrect center/right alligned text. +incorrect center/right aligned text. (Matjaz Gregoric, [#1117](https://github.com/prawnpdf/prawn/pull/1117)) diff --git a/README.md b/README.md index dcfe7c66d..4d6d5f654 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ for rendering rich HTML documents. Because Prawn is pure Ruby and all of its runtime dependencies are maintained by us, it should work pretty much anywhere. We officially support all Ruby versions -suported by Ruby Core Team and JRuby versions of matching Ruby version. However +supported by Ruby Core Team and JRuby versions of matching Ruby version. However we will accept patches to fix problems on other Ruby platforms if they aren't too invasive. diff --git a/lib/prawn/fonts/to_unicode_cmap.rb b/lib/prawn/fonts/to_unicode_cmap.rb index 84e856d4a..f25ebddf7 100644 --- a/lib/prawn/fonts/to_unicode_cmap.rb +++ b/lib/prawn/fonts/to_unicode_cmap.rb @@ -43,9 +43,9 @@ def generate used_code_space_size = @code_space_size || code_space_size # In CMap codespaces are not sequentional, they're ranges in - # a multi-dimentional space. Each byte is considered separately. So we + # a multi-dimensional space. Each byte is considered separately. So we # have to maximally extend the lower bytes in order to allow for - # continuos mapping. + # continuous mapping. # We only keep the highest byte because usually it's lower than # maximally allowed and we don't want to cover that unused space. code_space_max = max_glyph_index | ('ff' * (code_space_size - 1)).to_i(16) diff --git a/lib/prawn/fonts/ttf.rb b/lib/prawn/fonts/ttf.rb index 0abf5b742..10e89ed98 100644 --- a/lib/prawn/fonts/ttf.rb +++ b/lib/prawn/fonts/ttf.rb @@ -43,7 +43,7 @@ class NoUnicodeCMap < Error MESSAGE_WITH_FONT = 'No unicode cmap found in font %s' end - # Signals absense of a PostScript font name. + # Signals absence of a PostScript font name. class NoPostscriptName < Error # @private DEFAULT_MESSAGE = 'Can not detect a postscript name' @@ -89,9 +89,9 @@ def initialize(original) end # Codespaces are not sequentional, they're ranges in - # a multi-dimentional space. Each byte is considered separately. So we + # a multi-dimensional space. Each byte is considered separately. So we # have to maximally extend the lower two bytes in order to allow for - # continuos Unicode mapping. + # continuous Unicode mapping. # We only keep the highest byte because Unicode only goes to 1FFFFF # and fonts usually cover even less of the space. We don't want to # list all those unmapped charac codes here. @@ -437,7 +437,7 @@ def embed_subset(reference, subset) def embed_simple_font(reference, font, unicode_mapping) if font_type(font) == :unknown - raise Error, %(Simple font embedding is not uspported for font "#{font.name}.") + raise Error, %(Simple font embedding is not supported for font "#{font.name}.") end true_type = font_type(font) == :true_type @@ -522,7 +522,7 @@ def embed_full_font(reference) def embed_composite_font(reference, font) if font_type(font) == :unknown - raise Error, %(Composite font embedding is not uspported for font "#{font.name}.") + raise Error, %(Composite font embedding is not supported for font "#{font.name}.") end true_type = font_type(font) == :true_type diff --git a/lib/prawn/graphics.rb b/lib/prawn/graphics.rb index 1e5576100..adf9c4b10 100644 --- a/lib/prawn/graphics.rb +++ b/lib/prawn/graphics.rb @@ -778,7 +778,7 @@ def degree_to_rad(angle) end # Returns the coordinates for a point on a line that is a given distance - # away from the second point defining the line segement + # away from the second point defining the line segment def point_on_line(distance_from_end, *points) x0, y0, x1, y1 = points.flatten length = Math.sqrt(((x1 - x0)**2) + ((y1 - y0)**2)) diff --git a/lib/prawn/graphics/transformation.rb b/lib/prawn/graphics/transformation.rb index ad9dde77c..2231652c1 100644 --- a/lib/prawn/graphics/transformation.rb +++ b/lib/prawn/graphics/transformation.rb @@ -154,7 +154,7 @@ def scale(factor, options = {}, &block) def transformation_matrix(*matrix) if matrix.length != 6 raise ArgumentError, - 'Transformation matrix must have exacty 6 elements' + 'Transformation matrix must have exactly 6 elements' end save_graphics_state if block_given? diff --git a/lib/prawn/outline.rb b/lib/prawn/outline.rb index f56359b98..9186fa0a2 100644 --- a/lib/prawn/outline.rb +++ b/lib/prawn/outline.rb @@ -171,7 +171,7 @@ def insert_section_after(title, &block) # # @example # outline.section 'Added Section', destination: 3 do - # outline.page destionation: 3, title: 'Page 3' + # outline.page destination: 3, title: 'Page 3' # end # # @param title [String] The outline text that appears for the section. diff --git a/lib/prawn/text.rb b/lib/prawn/text.rb index b61cb7d0c..6062fba42 100644 --- a/lib/prawn/text.rb +++ b/lib/prawn/text.rb @@ -144,7 +144,7 @@ module Text # @return [void] # # @raise [ArgumentError] if `:at` option included - # @raise [Prawn::Errrors::CannotFit] if not wide enough to print any text + # @raise [Prawn::Errors::CannotFit] if not wide enough to print any text # # @see PDF::Core::Text#text_rendering_mode() # for a list of valid text rendering modes. @@ -256,7 +256,7 @@ def text(string, options = {}) # @return [void] # # @raise [ArgumentError] if `:at` option included - # @raise [Prawn::Errrors::CannotFit] if not wide enough to print any text + # @raise [Prawn::Errors::CannotFit] if not wide enough to print any text # # @see PDF::Core::Text#text_rendering_mode() # for a list of valid text rendering modes. @@ -471,7 +471,7 @@ def draw_text!(text, options) # @return [void] # # @raise [ArgumentError] if `:at` option included - # @raise [Prawn::Errrors::CannotFit] if not wide enough to print any text + # @raise [Prawn::Errors::CannotFit] if not wide enough to print any text # @raise [NotImplementedError] if `:indent_paragraphs` option included. # # @see PDF::Core::Text#text_rendering_mode() @@ -566,7 +566,7 @@ def height_of(string, options = {}) # @return [void] # # @raise [ArgumentError] if `:at` option included - # @raise [Prawn::Errrors::CannotFit] if not wide enough to print any text + # @raise [Prawn::Errors::CannotFit] if not wide enough to print any text # @raise [NotImplementedError] if `:indent_paragraphs` option included. # # @see PDF::Core::Text#text_rendering_mode() diff --git a/lib/prawn/text/formatted/wrap.rb b/lib/prawn/text/formatted/wrap.rb index c947778d6..5407787bc 100644 --- a/lib/prawn/text/formatted/wrap.rb +++ b/lib/prawn/text/formatted/wrap.rb @@ -28,7 +28,7 @@ def initialize(_array, options) # the descender height of the tallest fragment in the last # printed line # @ascender:: - # the ascender heigth of the tallest fragment in the last + # the ascender height of the tallest fragment in the last # printed line # @baseline_y:: # the baseline of the current line diff --git a/lib/prawn/view.rb b/lib/prawn/view.rb index d48e2c21c..c929ebe19 100644 --- a/lib/prawn/view.rb +++ b/lib/prawn/view.rb @@ -102,7 +102,7 @@ def update(&block) instance_eval(&block) end - # Syntatic sugar that calls `document.render_file` under the hood. + # Syntactic sugar that calls `document.render_file` under the hood. # # @example # greeter.save_as("greetings.pdf") diff --git a/manual/document_and_page_options.rb b/manual/document_and_page_options.rb index 595c7c6ee..d9a9c9941 100644 --- a/manual/document_and_page_options.rb +++ b/manual/document_and_page_options.rb @@ -9,7 +9,7 @@ prose <<-TEXT So far we've already seen how to create new documents and start new pages. This chapter expands on the previous examples by showing other - options avialable. Some of the options are only available when creating + options available. Some of the options are only available when creating new documents. The examples show: diff --git a/manual/graphics/lines_and_curves.rb b/manual/graphics/lines_and_curves.rb index 0601104bf..e99fd99d4 100644 --- a/manual/graphics/lines_and_curves.rb +++ b/manual/graphics/lines_and_curves.rb @@ -19,7 +19,7 @@ line and curve set the drawing path between the two specified points. - Both curve methods define a Bezier curve bounded by two aditional points + Both curve methods define a Bezier curve bounded by two additional points provided as the :bounds param. TEXT end diff --git a/spec/prawn/document_grid_spec.rb b/spec/prawn/document_grid_spec.rb index 94f77ad67..712fb0e48 100644 --- a/spec/prawn/document_grid_spec.rb +++ b/spec/prawn/document_grid_spec.rb @@ -83,7 +83,7 @@ expect(colors.stroke_color).to eq([0.0, 0.0, 0.0]) end - it 'draws outlines without curent color settings' do + it 'draws outlines without current color settings' do pdf.fill_color('ccff00') pdf.stroke_color('ffcc00') diff --git a/spec/prawn/document_spec.rb b/spec/prawn/document_spec.rb index 6132b3fcc..4458f3d38 100644 --- a/spec/prawn/document_spec.rb +++ b/spec/prawn/document_spec.rb @@ -190,7 +190,7 @@ def self.format(string) context 'with an invalid index' do let(:expected_content) { ['Page one', 'Page two', 'Page three'] } - it 'does not destroy an invalid positve index' do + it 'does not destroy an invalid positive index' do pdf.delete_page(42) expect(pdf.page_number).to eq(3) text_analysis = PDF::Inspector::Text.analyze(pdf.render) diff --git a/spec/prawn/font_spec.rb b/spec/prawn/font_spec.rb index 08ca05400..0c4f31e1b 100644 --- a/spec/prawn/font_spec.rb +++ b/spec/prawn/font_spec.rb @@ -489,7 +489,7 @@ def page_includes_font?(font) expect(desc_font[:W][1].length).to eq(6108) # All glyph metrics end - it 'propely embeds font data' do + it 'properly embeds font data' do descriptor = ref.data[:DescendantFonts].first.data[:FontDescriptor].data expect(descriptor).to have_key(:FontFile2) expect(descriptor[:FontFile2].data[:Length1]).to eq(741_536) @@ -564,7 +564,7 @@ def page_includes_font?(font) expect(desc_font[:W][1].length).to eq(353) # All glyph metrics end - it 'propely embeds font data' do + it 'properly embeds font data' do descriptor = ref.data[:DescendantFonts].first.data[:FontDescriptor].data expect(descriptor).to have_key(:FontFile3) expect(descriptor[:FontFile3].stream).to_not be_empty diff --git a/spec/prawn/outline_spec.rb b/spec/prawn/outline_spec.rb index d1c51ee62..697bdf1c4 100644 --- a/spec/prawn/outline_spec.rb +++ b/spec/prawn/outline_spec.rb @@ -142,7 +142,7 @@ end end - describe 'addding a section later with outline#section' do + describe 'adding a section later with outline#section' do before do pdf.start_new_page pdf.text('Page 3. An added section ') @@ -176,7 +176,7 @@ expect(referenced_object(section1[:Next])).to eq(section2) end - it 'sets the previous relation of the addded to section' do + it 'sets the previous relation of the added to section' do section1 = find_by_title('Chapter 1') section2 = find_by_title('Added Section') diff --git a/spec/prawn/text/formatted/arranger_spec.rb b/spec/prawn/text/formatted/arranger_spec.rb index 64d2ec18b..711e81720 100644 --- a/spec/prawn/text/formatted/arranger_spec.rb +++ b/spec/prawn/text/formatted/arranger_spec.rb @@ -119,7 +119,7 @@ end describe '#retrieve_fragment' do - context 'with a formatted array whos text is an empty string' do + context 'with a formatted array whose text is an empty string' do let(:array) do [ { text: "hello\nworld\n\n\nhow are you?" }, diff --git a/spec/prawn/text/formatted/fragment_spec.rb b/spec/prawn/text/formatted/fragment_spec.rb index 4c912fc17..de88cc9fd 100644 --- a/spec/prawn/text/formatted/fragment_spec.rb +++ b/spec/prawn/text/formatted/fragment_spec.rb @@ -36,7 +36,7 @@ expect(fragment.styles).to eq(%i[bold italic]) end - it 'nevers return nil' do + it 'never returns nil' do format_state = { styles: nil, color: nil, diff --git a/spec/prawn/text/formatted/parser_spec.rb b/spec/prawn/text/formatted/parser_spec.rb index f80169612..eac6f98bc 100644 --- a/spec/prawn/text/formatted/parser_spec.rb +++ b/spec/prawn/text/formatted/parser_spec.rb @@ -234,7 +234,7 @@ ) end - it 'handles double qoutes around tag attributes' do + it 'handles double quotes around tag attributes' do string = 'some sized text' array = described_class.format(string) expect(array[1]).to eq( @@ -250,7 +250,7 @@ ) end - it 'handles single qoutes around tag attributes' do + it 'handles single quotes around tag attributes' do string = "some sized text" array = described_class.format(string) expect(array[1]).to eq( diff --git a/spec/prawn_manual_spec.rb b/spec/prawn_manual_spec.rb index 3baec925c..46b39e7a1 100644 --- a/spec/prawn_manual_spec.rb +++ b/spec/prawn_manual_spec.rb @@ -15,7 +15,7 @@ describe 'manual' do # JRuby's zlib is a bit quirky. It sometimes produces different output to # libzlib (used by MRI). It's still a proper deflate stream and can be - # decompressed just fine but for whatever reason compressin produses + # decompressed just fine, but for whatever reason, compression produces # different output. # # See: https://github.com/jruby/jruby/issues/4244