Skip to content

Commit

Permalink
correct some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
defkode committed Dec 13, 2024
1 parent c531f87 commit fb5a42d
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions lib/prawn/fonts/to_unicode_cmap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions lib/prawn/fonts/ttf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class NoUnicodeCMap < Error
MESSAGE_WITH_FONT = 'No unicode cmap found in font %<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'
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/prawn/graphics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion lib/prawn/graphics/transformation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
2 changes: 1 addition & 1 deletion lib/prawn/outline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions lib/prawn/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion lib/prawn/text/formatted/wrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def initialize(_array, options)
# the descender height of the tallest fragment in the last
# printed line
# <tt>@ascender</tt>::
# the ascender heigth of the tallest fragment in the last
# the ascender height of the tallest fragment in the last
# printed line
# <tt>@baseline_y</tt>::
# the baseline of the current line
Expand Down
2 changes: 1 addition & 1 deletion lib/prawn/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion manual/document_and_page_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion manual/graphics/lines_and_curves.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<code>line</code> and <code>curve</code> 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 <code>:bounds</code> param.
TEXT
end
Expand Down
2 changes: 1 addition & 1 deletion spec/prawn/document_grid_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion spec/prawn/document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions spec/prawn/font_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/prawn/outline_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 ')
Expand Down Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion spec/prawn/text/formatted/arranger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?" },
Expand Down
2 changes: 1 addition & 1 deletion spec/prawn/text/formatted/fragment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions spec/prawn/text/formatted/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
)
end

it 'handles double qoutes around tag attributes' do
it 'handles double quotes around tag attributes' do
string = 'some <font size="14">sized</font> text'
array = described_class.format(string)
expect(array[1]).to eq(
Expand All @@ -250,7 +250,7 @@
)
end

it 'handles single qoutes around tag attributes' do
it 'handles single quotes around tag attributes' do
string = "some <font size='14'>sized</font> text"
array = described_class.format(string)
expect(array[1]).to eq(
Expand Down
2 changes: 1 addition & 1 deletion spec/prawn_manual_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb5a42d

Please sign in to comment.