Skip to content

Commit 0f01e0b

Browse files
yulian-gaponenkoiText-CI
authored andcommitted
Improve javadocs for new code in Type3Font handling
DEVSIX-5199 Autoported commit. Original commit hash: [8a77dd3dc]
1 parent 0c7952a commit 0f01e0b

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

itext/itext.kernel/itext/kernel/font/PdfFont.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ public virtual bool AppendDecodedCodesToGlyphsList(IList<Glyph> list, PdfString
200200

201201
public abstract void WriteText(String text, PdfOutputStream stream);
202202

203-
[Obsolete]
203+
/// <summary>Gets the transformation matrix that defines relation between text and glyph spaces.</summary>
204+
/// <returns>the font matrix</returns>
205+
[System.ObsoleteAttribute(@"Use iText.IO.Font.FontProgram.UNITS_NORMALIZATION constant for conversion between text and glyph space. For now we opted to always expect that all PdfFont metrics in glyph-space are related to text space as 1 to 1000, as it is defined for the majority of fonts. For fonts which don't necessary follow this rule (see PdfType3Font ), we perform internal normalization of font metrics in order to adhere to this common expectation. This method will be removed in next major release."
206+
)]
204207
public virtual double[] GetFontMatrix() {
205208
return DEFAULT_FONT_MATRIX;
206209
}

itext/itext.kernel/itext/kernel/font/PdfSimpleFont.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,11 @@ protected internal virtual void SetFontProgram(T fontProgram) {
518518
this.fontProgram = fontProgram;
519519
}
520520

521-
[Obsolete]
521+
/// <summary>Gets glyph width which us ready to be written to the output file.</summary>
522+
/// <param name="glyph">the glyph which widths is required to be written to the output file</param>
523+
/// <returns>glyph width in glyph-space</returns>
524+
[System.ObsoleteAttribute(@"This method was introduced to allow overriding of widths array entry writing to output file. It's now replaced by more specific PdfSimpleFont{T}.BuildWidthsArray(int, int) in order to avoid confusion between this method and iText.IO.Font.Otf.Glyph.GetWidth() . This method will be removed in the next major release."
525+
)]
522526
protected internal virtual double GetGlyphWidth(Glyph glyph) {
523527
return glyph != null ? glyph.GetWidth() : 0;
524528
}

itext/itext.kernel/itext/kernel/font/Type3Font.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ public virtual int GetNumberOfGlyphs() {
145145
/// </remarks>
146146
/// <param name="fontName">the PostScript name of the font, shall not be null or empty.</param>
147147
protected internal override void SetFontName(String fontName) {
148-
// This dummy override allows PdfType3Font to set font name from different module.
148+
// This dummy override allows PdfType3Font to use setter from different module.
149149
base.SetFontName(fontName);
150150
}
151151

152152
/// <summary>Sets a preferred font family name.</summary>
153153
/// <param name="fontFamily">a preferred font family name.</param>
154154
protected internal override void SetFontFamily(String fontFamily) {
155-
// This dummy override allows PdfType3Font to set font name from different module.
155+
// This dummy override allows PdfType3Font to use setter from different module.
156156
base.SetFontFamily(fontFamily);
157157
}
158158

@@ -162,7 +162,7 @@ protected internal override void SetFontFamily(String fontFamily) {
162162
/// <see cref="iText.IO.Font.Constants.FontWeights"/>.
163163
/// </param>
164164
protected internal override void SetFontWeight(int fontWeight) {
165-
// This dummy override allows PdfType3Font to set font name from different module.
165+
// This dummy override allows PdfType3Font to use setter from different module.
166166
base.SetFontWeight(fontWeight);
167167
}
168168

@@ -172,31 +172,31 @@ protected internal override void SetFontWeight(int fontWeight) {
172172
/// <see cref="iText.IO.Font.Constants.FontStretches"/>.
173173
/// </param>
174174
protected internal override void SetFontStretch(String fontWidth) {
175-
// This dummy override allows PdfType3Font to set font name from different module.
175+
// This dummy override allows PdfType3Font to use setter from different module.
176176
base.SetFontStretch(fontWidth);
177177
}
178178

179179
/// <summary><inheritDoc/></summary>
180180
protected internal override void SetCapHeight(int capHeight) {
181-
// This dummy override allows PdfType3Font to set the PostScript italicAngle from different module.
181+
// This dummy override allows PdfType3Font to use setter from different module.
182182
base.SetCapHeight(capHeight);
183183
}
184184

185185
/// <summary><inheritDoc/></summary>
186186
protected internal override void SetItalicAngle(int italicAngle) {
187-
// This dummy override allows PdfType3Font to set the PostScript italicAngle from different module.
187+
// This dummy override allows PdfType3Font to use setter from different module.
188188
base.SetItalicAngle(italicAngle);
189189
}
190190

191191
/// <summary><inheritDoc/></summary>
192192
protected internal override void SetTypoAscender(int ascender) {
193-
// This dummy override allows PdfType3Font to set typoAscender from different module.
193+
// This dummy override allows PdfType3Font to use setter from different module.
194194
base.SetTypoAscender(ascender);
195195
}
196196

197197
/// <summary><inheritDoc/></summary>
198198
protected internal override void SetTypoDescender(int descender) {
199-
// This dummy override allows PdfType3Font to set typoDescender from different module.
199+
// This dummy override allows PdfType3Font to use setter from different module.
200200
base.SetTypoDescender(descender);
201201
}
202202

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c72ff11f48c00ff895ba747c0a1cbeeaffdf66e1
1+
8a77dd3dc42cfe5f07b3bc59e15c3aa04a3e0c7a

0 commit comments

Comments
 (0)