Skip to content

Commit

Permalink
Fix and improve link, fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
deining committed Jan 11, 2025
1 parent 17cba7c commit e5e60ee
Show file tree
Hide file tree
Showing 23 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Alexander Peslyak

Peter Selinger
libs/potrace/*
http://potrace.sourceforge.net
https://potrace.sourceforge.net

2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ dvisvgm-0.5 (2007-03-26)
- command-line option -m has been renamed to -M
- added command-line options -m/--map-file and -n/--no-mktexmf
- memory bug in StreamCounter class has been fixed
- added sources of Peter Selinger's potrace library (part of potrace, http://potrace.sourceforge.net)
- added sources of Peter Selinger's potrace library (part of potrace, https://potrace.sourceforge.net)
to simplify the build process

dvisvgm-0.4.3 (2007-01-03)
Expand Down
8 changes: 4 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ DESCRIPTION
DEPENDENCIES

dvisvgm relies on the following free libraries:
* Clipper (http://www.angusj.com/delphi/clipper.php)
* Clipper (https://www.angusj.com/delphi/clipper/documentation/Docs/Overview/_Body.htm)
To compute the intersections of two curved paths, dvisvgm flattens the paths
to polygons, intersects them using Clipper, and reconstructs the curves
afterwards.

* FreeType 2 (http://www.freetype.org)
* FreeType 2 (https://freetype.org)
This library is used to extract the glyph outlines from vector fonts
(PFB, OTF, TTF).

Expand All @@ -34,7 +34,7 @@ DEPENDENCIES
searching files in the large texmf tree. Please ensure that you use the
kpathsea version coming with or matching your TeX system.

* potracelib (http://potrace.sourceforge.net)
* potracelib (https://potrace.sourceforge.net)
Peter Selinger's bitmap tracing library is utilized to vectorize Metafont's
bitmap output. A recent version is also part of the dvisvgm sources.

Expand All @@ -55,7 +55,7 @@ DEPENDENCIES
store them in a compact way together with their Unicode points. A recent
version of xxHash is bundled with the dvisvgm sources.

* zlib (http://www.zlib.org)
* zlib (https://www.zlib.net)
This library is required to create compressed SVGZ files.


Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ _dvisvgm_ is a utility for TeX/LaTeX users. It converts
XML-based scalable vector graphics format [SVG](https://www.w3.org/TR/SVG).
The latest releases support standard DVI files (version 2) as well as DVI output
created by [pTeX](https://ctan.org/pkg/ptex) in vertical mode (version 3),
and [XeTeX](http://scripts.sil.org/xetex) (versions 5 to 7, also known as XDV).
and [XeTeX](https://xetex.sourceforge.net) (versions 5 to 7, also known as XDV).

To get an impression of the conversion results, have a look at the
[examples](https://dvisvgm.de/Examples) created with _dvisvgm_.
Expand Down Expand Up @@ -53,12 +53,12 @@ Dependencies

_dvisvgm_ relies on the following free libraries:

* [Clipper](http://www.angusj.com/delphi/clipper.php)
* [Clipper](https://www.angusj.com/delphi/clipper/documentation/Docs/Overview/_Body.htm)
To compute the intersection of two curved paths, _dvisvgm_ flattens the paths to
polygons, intersects them using a slightly modified version of Clipper, and reconstructs
the curves afterwards. A slightly modified version of Clipper is bundled with the sources.

* [FreeType 2](https://www.freetype.org)
* [FreeType 2](https://freetype.org)
This library is used to extract the glyph outlines from vector fonts (PFB, OTF, TTF).

* [Ghostscript](https://www.ghostscript.com)
Expand All @@ -76,7 +76,7 @@ _dvisvgm_ relies on the following free libraries:
files in the large `texmf` tree. Please ensure that you use the kpathsea version
coming with or matching your TeX system.

* [potracelib](http://potrace.sourceforge.net)
* [potracelib](https://potrace.sourceforge.net)
Peter Selinger's bitmap tracing library is utilized to vectorize Metafont's
bitmap output. It's also bundled with the _dvisvgm_ sources.

Expand All @@ -96,14 +96,14 @@ _dvisvgm_ relies on the following free libraries:
a compact way together with their Unicode points. A recent version of xxHash is
bundled with the _dvisvgm_ sources.

* [zlib](http://www.zlib.org)
* [zlib](https://www.zlib.net)
This library is required to create compressed [SVGZ](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics#Compression) files.


Building dvisvgm from source
----------------------------

_dvisvgm_ is written in C++11 ([ISO C++ standard 2011](http://www.iso.org/iso/catalogue_detail.htm?csnumber=50372))
_dvisvgm_ is written in C++11 ([ISO C++ standard 2011](https://www.iso.org/standard/83626.html))
and requires an appropriate compiler, like [GCC](https://gcc.gnu.org) 4.9, [Clang](https://clang.llvm.org) 3.3,
or any later version. The configure script checks for the availability of C++11 support and
adds the proper compiler options if necessary.
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ AX_GCC_BUILTIN(__builtin_clz)

# add options for selection of "optional" library locations
# currently these libraries are mandatory; the --with-foo options
# are used to specify the locations explicitely
# are used to specify the locations explicitly

AC_ARG_WITH(zlib,
[AS_HELP_STRING([--with-zlib=DIR], [set location of the zlib library])],
Expand Down
12 changes: 6 additions & 6 deletions src/DVIReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void DVIReader::cmdPop (int) {
}


/** Helper function that handles charaters from virtual fonts (VF).
/** Helper function that handles characters from virtual fonts (VF).
* It is called by the cmdSetChar and cmdPutChar methods.
* @param[in] font current font (corresponding to _currFontNum)
* @param[in] c character to typeset */
Expand Down Expand Up @@ -243,7 +243,7 @@ void DVIReader::putVFChar (Font *font, uint32_t c) {
/** Reads and executes set_char_x command. Puts a character at the current
* position and advances the cursor.
* @param[in] c character to set
* @throw DVIException if method is called ouside a bop/eop pair */
* @throw DVIException if method is called outside a bop/eop pair */
void DVIReader::cmdSetChar0 (int c) {
if (!_inPage)
throw DVIException("setchar outside of page");
Expand All @@ -257,7 +257,7 @@ void DVIReader::cmdSetChar0 (int c) {
/** Reads and executes setx command. Puts a character at the current
* position and advances the cursor.
* @param[in] len number of parameter bytes (possible values: 1-4)
* @throw DVIException if method is called ouside a bop/eop pair */
* @throw DVIException if method is called outside a bop/eop pair */
void DVIReader::cmdSetChar (int len) {
if (!_inPage)
throw DVIException("setchar outside of page");
Expand All @@ -274,7 +274,7 @@ void DVIReader::cmdSetChar (int len) {
/** Reads and executes putx command. Puts a character at the current
* position but doesn't change the cursor position.
* @param[in] len number of parameter bytes (possible values: 1-4)
* @throw DVIException if method is called ouside a bop/eop pair */
* @throw DVIException if method is called outside a bop/eop pair */
void DVIReader::cmdPutChar (int len) {
if (!_inPage)
throw DVIException("putchar outside of page");
Expand All @@ -290,7 +290,7 @@ void DVIReader::cmdPutChar (int len) {
/** Reads and executes set_rule command. Puts a solid rectangle at the current
* position and updates the cursor position.
* Format: set_rule h[+4] w[+4]
* @throw DVIException if method is called ouside a bop/eop pair */
* @throw DVIException if method is called outside a bop/eop pair */
void DVIReader::cmdSetRule (int) {
if (!_inPage)
throw DVIException("set_rule outside of page");
Expand All @@ -304,7 +304,7 @@ void DVIReader::cmdSetRule (int) {
/** Reads and executes set_rule command. Puts a solid rectangle at the current
* position but leaves the cursor position unchanged.
* Format: put_rule h[+4] w[+4]
* @throw DVIException if method is called ouside a bop/eop pair */
* @throw DVIException if method is called outside a bop/eop pair */
void DVIReader::cmdPutRule (int) {
if (!_inPage)
throw DVIException("put_rule outside of page");
Expand Down
18 changes: 9 additions & 9 deletions src/DvisvgmSpecialHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,26 +382,26 @@ void DvisvgmSpecialHandler::processImg (InputReader &ir, SpecialActions &actions
Message::wstream(true) << "file '" << fname << "' not found\n";

update_bbox(width, height, Length(0), true, actions);
auto imgageNode = util::make_unique<SVGElement>("image");
imgageNode->addAttribute("x", actions.getX());
imgageNode->addAttribute("y", actions.getY()-height.bp());
imgageNode->addAttribute("width", width.bp());
imgageNode->addAttribute("height", height.bp());
auto imageNode = util::make_unique<SVGElement>("image");
imageNode->addAttribute("x", actions.getX());
imageNode->addAttribute("y", actions.getY()-height.bp());
imageNode->addAttribute("width", width.bp());
imageNode->addAttribute("height", height.bp());

string mimetype = util::mimetype(fname);
if (SVGTree::EMBED_BITMAP_DATA && (mimetype == "image/jpeg" || mimetype == "image/png"))
imgageNode->addAttribute("@@xlink:href", "data:"+mimetype+";base64,"+fname);
imageNode->addAttribute("@@xlink:href", "data:"+mimetype+";base64,"+fname);
else {
string href = fname;
// Only reference the image with an absolute path if either an absolute path was given by the user
// or a given plain filename is not present in the current working directory but was found through
// the FileFinder, i.e. it's usually located somewhere in the texmf tree.
if (!FilePath::isAbsolute(fname) && (fname.find('/') != string::npos || FilePath(fname).exists()))
href = FilePath(pathstr).relative(FilePath(actions.getSVGFilePath(1)));
imgageNode->addAttribute("xlink:href", href);
imageNode->addAttribute("xlink:href", href);
}
imgageNode->setTransform(actions.getMatrix());
actions.svgTree().appendToPage(std::move(imgageNode));
imageNode->setTransform(actions.getMatrix());
actions.svgTree().appendToPage(std::move(imageNode));
}
catch (const UnitException &e) {
throw SpecialException(string("dvisvgm:img: ") + e.what());
Expand Down
2 changes: 1 addition & 1 deletion src/DvisvgmSpecialHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class XMLNode;

#ifdef _MSC_VER
// MSVC: Prevent aggressive optimization of pointers to member functions.
// Instatiating class DvisvgmSpecialHandler without the following pragma
// Instantiating class DvisvgmSpecialHandler without the following pragma
// leads to memory corruption.
// https://docs.microsoft.com/en-us/cpp/preprocessor/pointers-to-members
#pragma pointers_to_members(full_generality, single_inheritance)
Expand Down
2 changes: 1 addition & 1 deletion src/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ int PhysicalFont::traceAllGlyphs (bool includeCached, GFGlyphTracer::Callback *c
/** Computes the exact bounding box of a glyph.
* @param[in] c character code of the glyph
* @param[out] bbox the computed bounding box
* @param[in] cb optional calback object forwarded to the tracer
* @param[in] cb optional callback object forwarded to the tracer
* @return true if the box could be computed successfully */
bool PhysicalFont::getExactGlyphBox (int c, BoundingBox& bbox, GFGlyphTracer::Callback* cb) const {
Glyph glyph;
Expand Down
2 changes: 1 addition & 1 deletion src/FontEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ int FontEngine::getNumGlyphs () const {
}


/** Returns the glyph name for a given charater code.
/** Returns the glyph name for a given character code.
* @param[in] c char code
* @return glyph name */
string FontEngine::getGlyphName (const Character &c) const {
Expand Down
2 changes: 1 addition & 1 deletion src/Ghostscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ int Ghostscript::set_stdio (Stdin in, Stdout out, Stderr err) {

/** Initializes Ghostscript with a set of optional parameters. This
* method is called by the constructor and should not be used elsewhere.
* @param[in] argc number of paramters
* @param[in] argc number of parameters
* @param[in] argv parameters passed to Ghostscript */
int Ghostscript::init_with_args (int argc, char **argv) {
#if defined(HAVE_LIBGS)
Expand Down
2 changes: 1 addition & 1 deletion src/HtmlSpecialHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void HtmlSpecialHandler::preprocess (const string&, istream &is, SpecialActions
if (ir.check("<a ") && ir.parseAttributes(attribs, true, "\"") > 0) {
map<string,string>::iterator it;
if ((it = attribs.find("name")) != attribs.end())
HyperlinkManager::instance().addNameAchor(it->second, actions.getCurrentPageNumber());
HyperlinkManager::instance().addNameAnchor(it->second, actions.getCurrentPageNumber());
else if ((it = attribs.find("href")) != attribs.end())
HyperlinkManager::instance().addHrefAnchor(it->second);
}
Expand Down
2 changes: 1 addition & 1 deletion src/HyperlinkManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void HyperlinkManager::addHrefAnchor (const string &uri) {
}


void HyperlinkManager::addNameAchor (const string &name, int pageno) {
void HyperlinkManager::addNameAnchor (const string &name, int pageno) {
if (name.empty())
return;
auto it = _namedAnchors.find(name);
Expand Down
2 changes: 1 addition & 1 deletion src/HyperlinkManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class HyperlinkManager {
HyperlinkManager (const HyperlinkManager&) =delete;
HyperlinkManager (HyperlinkManager&&) =delete;
void addHrefAnchor (const std::string &uri);
void addNameAchor (const std::string &name, int pageno);
void addNameAnchor (const std::string &name, int pageno);
void setActiveNameAnchor (const std::string &name, SpecialActions &actions);
void closeAnchor (SpecialActions &actions);
void checkNewLine (SpecialActions &actions);
Expand Down
2 changes: 1 addition & 1 deletion src/PDFParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ using NumberVariant = mpark::variant<int, double>;
/** Parses a PDF number from a string. The number is either integer or real.
* @param[in] str string to parse
* @param[out] nv variant holding the numeric value
* @return true if entire string has been parsed succesfully */
* @return true if entire string has been parsed successfully */
static bool parse_number (const string &str, NumberVariant &nv) {
if (str.empty())
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/PSPattern.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class PSPattern {
virtual std::unique_ptr<XMLElement> createPatternNode () const =0;

private:
int _id; ///< PostSCript ID of this pattern
int _id; ///< PostScript ID of this pattern
};


Expand All @@ -70,7 +70,7 @@ class PSTilingPattern : public PSPattern {
private:
BoundingBox _bbox; ///< bounding box of the tile graphics
Matrix _matrix; ///< tile transformation
double _xstep, _ystep; ///< horizontal and vertical distance between neighboured tiles
double _xstep, _ystep; ///< horizontal and vertical distance between neighbouring tiles
mutable std::unique_ptr<XMLElement> _groupNode; ///< group containing the drawing elements
XMLElement *_groupNodePtr; ///< keeps a pointer to the group node even after moving _groupNode to the SVGTree
};
Expand Down
2 changes: 1 addition & 1 deletion src/PdfSpecialHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void PdfSpecialHandler::preprocessDest (StreamInputReader &ir, SpecialActions &a
// get target info from array [pageno /XYZ xpos ypos zpos]
if (name && dest && dest->size() >= 4 && dest->at(0).get<int>()) {
int pageno = *dest->at(0).get<int>();
HyperlinkManager::instance().addNameAchor(*name, pageno);
HyperlinkManager::instance().addNameAnchor(*name, pageno);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/VFReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void VFReader::cmdPre () {
uint32_t i = readUnsigned(1); // identification number (should be 2)
uint32_t k = readUnsigned(1); // length of following comment
string cmt = readString(k); // comment
uint32_t cs = readUnsigned(4); // check sum to be compared with TFM cecksum
uint32_t cs = readUnsigned(4); // check sum to be compared with TFM checksum
int32_t ds = readUnsigned(4); // design size (same as TFM design size) (fix_word)
_designSize = double(FixWord(ds))*Length::pt2bp;
if (i != 202)
Expand Down
2 changes: 1 addition & 1 deletion src/XMLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static string::size_type find_end_of_tag (const string &str, string::size_type s
char attrval_delim = 0;
bool expect_attrval = false;
for (auto i=startpos; i < str.length(); i++) {
if (attrval_delim) { // inside attrubute value?
if (attrval_delim) { // inside attribute value?
if (str[i] == attrval_delim) // end of attribute value?
attrval_delim = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/optimizer/TransformSimplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool TransformSimplifier::incorporateTransform (XMLElement *elem, const Matrix &
y = strtod(ystr, nullptr);
// width and height attributes must not become negative. Hence, only apply the scaling
// values if they are non-negative. Otherwise, keep a scaling matrix. Also retain scaling
// transformations in image elements to avoid the need of attribute 'preseveAspectRatio'.
// transformations in image elements to avoid the need of attribute 'preserveAspectRatio'.
if (sx < 0 || sy < 0 || elem->name() == "image") {
x += (sx == 0 ? 0 : tx/sx);
y += (sy == 0 ? 0 : ty/sy);
Expand Down
2 changes: 1 addition & 1 deletion src/ttf/GlyfTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void Contour::reduceNumberOfPoints () {

/** Bits of the "Simple Glyph Flags". See section "Simple Glyph Description" of glyf table documentation. */
enum : uint8_t {
ON_CURVE_PT = 1, ///< if set, corresponing point is on the curve, otherwise off the curve (= control point)
ON_CURVE_PT = 1, ///< if set, corresponding point is on the curve, otherwise off the curve (= control point)
X_SHORT = 2, ///< if set, the corresponding x-coordinate is 1 byte long, otherwise it's two bytes long
Y_SHORT = 4, ///< if set, the corresponding y-coordinate is 1 byte long, otherwise it's two bytes long
REPEAT_FLAG = 8, ///< if set, the next byte specifies the number of additional times this flag is to be repeated
Expand Down
4 changes: 2 additions & 2 deletions src/ttf/NameTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ enum NameID {
PS_CID_FINDFONT_NAME = 20,
WWS_FAMILY_NAME = 21,
WWS_SUBFAMILY_NAME = 22,
LIGHT_BG_PALLETTE = 23,
DARK_BG_PALLETTE = 24,
LIGHT_BG_PALETTE = 23,
DARK_BG_PALETTE = 24,
VAR_PS_NAME_PREFIX = 25
};

Expand Down
2 changes: 1 addition & 1 deletion src/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ int util::ilog10 (int n) {
* @param[in] is stream to read from
* @param[out] str the read string is appended to this one
* @param[in] allow_leading_sign true if the first character may be '+' or '-'
* @return true if the string coule be read successfully */
* @return true if the string could be read successfully */
static bool read_int_string (istream &is, string &str, bool allow_leading_sign=true) {
string intstr;
if (is.peek() == '-' || is.peek() == '+') {
Expand Down

0 comments on commit e5e60ee

Please sign in to comment.