Skip to content

Commit

Permalink
equalize line spacing. fixes #30
Browse files Browse the repository at this point in the history
  • Loading branch information
wissenbach committed Jul 9, 2018
1 parent 0a30892 commit 34e5ea4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions svg_rendering/page/js-gen/transcript-configuration-faust.js
Expand Up @@ -258,15 +258,15 @@ if (window.Faust === undefined) {
}

if (rendTokens.indexOf("underline") >= 0) {
var underline = new FaustTranscript.LineDecoration(textVC, handClasses, 'underline', 0.1);
var underline = new FaustTranscript.LineDecoration(textVC, handClasses, 'underline', 0.9);
textVC.decorations.push(underline);
}
if (rendTokens.indexOf("underdots") >= 0) {
var underdots = new FaustTranscript.LineDecoration(textVC, handClasses, 'underdots', 0.2);
var underdots = new FaustTranscript.LineDecoration(textVC, handClasses, 'underdots', 0.9);
textVC.decorations.push(underdots);
}
if (rendTokens.indexOf("overline") >= 0) {
var overline = new FaustTranscript.LineDecoration(textVC, handClasses, 'overline', -0.7);
var overline = new FaustTranscript.LineDecoration(textVC, handClasses, 'overline', 0.1);
textVC.decorations.push(overline);
}

Expand Down Expand Up @@ -510,7 +510,7 @@ if (window.Faust === undefined) {
textVC.decorations.push(decoration);

} else {
decoration = new FaustTranscript.LineDecoration(textVC, classes, 'strikethrough', -0.2 - yOffset);
decoration = new FaustTranscript.LineDecoration(textVC, classes, 'strikethrough', 0.6 - yOffset);
textVC.decorations.push(decoration);
}

Expand Down
5 changes: 3 additions & 2 deletions svg_rendering/page/js-gen/transcript-svg.js
Expand Up @@ -232,6 +232,8 @@ if (window.FaustTranscript === undefined) {
wrapper.setAttribute('class', 'text-wrapper');
this.textElement = this.svgDocument().createElementNS(SVG_NS, "text");
this.textElement.setAttribute("class", "text " + this.getClassesString());
this.textElement.setAttribute("dominant-baseline", "hanging");

this.textElement.appendChild(this.svgDocument().createTextNode(this.text));
wrapper.appendChild(this.textElement);
return wrapper;
Expand Down Expand Up @@ -408,7 +410,6 @@ if (window.FaustTranscript === undefined) {
g.setAttribute('vector-effect', 'non-scaling-stroke');
var transform = "scale(" + this.displayWidth / this.imageWidth + "," + this.displayHeight / this.imageHeight + ")";
this.graphic.setAttribute('transform', transform);
g.setAttribute('transform', 'translate(0, -' + this.displayHeight + ')');
g.appendChild(this.graphic);
return g;
};
Expand Down Expand Up @@ -457,7 +458,7 @@ if (window.FaustTranscript === undefined) {
var textBBox = this.text.textElement.getBBox();
this.view.setAttribute("x1", textBBox.x);
this.view.setAttribute("x2", textBBox.x + textBBox.width);
var y = textBBox.height * this.yOffset;
var y = textBBox.y + (textBBox.height * this.yOffset);
this.view.setAttribute("y1", y);
this.view.setAttribute('y2', y);
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion svg_rendering/page/js-gen/transcript.js
Expand Up @@ -395,7 +395,7 @@ if (window.FaustTranscript === undefined) {
this.setAlign("hAlign", new FaustTranscript.Align(this, this.parent, this.rotX(), 0, 0, FaustTranscript.Align.IMPLICIT_BY_DOC_ORDER));
}

INTERLINE_DISTANCE = 0.5;
INTERLINE_DISTANCE = 0.58;
REGULAR_LINE_DISTANCE = 1;

if (this.previous()) {
Expand Down

0 comments on commit 34e5ea4

Please sign in to comment.