XSL:FO avoid Space between Table Cells - xslt-2.0

Hello guy I have two table Cells and a <fo:leader/> in both Cells. How can i avoid to get a space between the two Cells. It's not possible to span the two cells.
I use Antennahouse and XSLT 2.0 .
Here is my Code for the table
<fo:table width="100%" >
<fo:table-column column-width="50%"/>
<fo:table-column column-width="50%"/>
<fo:table-body >
<fo:table-row>
<fo:table-cell >
<fo:block border-right-width="0.0mm" >
<xsl:if test="page">
<xsl:attribute name="text-align-last">justify</xsl:attribute>
</xsl:if>
<xsl:value-of select="concat(#ref1,' ')"/>
<xsl:if test="page">
<fo:leader leader-pattern="dots"/>
</xsl:if>
</fo:block>
</fo:table-cell>
<fo:table-cell >
<fo:block text-align="justify" text-align-last="right" axf:text-align-first="justify">
<xsl:if test="page">
<fo:leader leader-pattern="dots" />
</xsl:if>
<fo:inline><xsl:apply-templates select="page" mode="normal"><xsl:with-param name="chapter" select="#chapterNumber"></xsl:with-param></xsl:apply-templates></fo:inline></fo:block>
</fo:table-cell>
</fo:table-row>

Without all the other stuff you have, with pure XSL FO and no extensions this works for me:
<fo:table width="100%" >
<fo:table-column column-width="50%"/>
<fo:table-column column-width="50%"/>
<fo:table-body >
<fo:table-row>
<fo:table-cell>
<fo:block text-align-last="justify">
<fo:inline>Stuff</fo:inline>
<fo:leader leader-pattern="dots"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align-last="justify">
<fo:leader leader-pattern="dots" />
<fo:inline>1</fo:inline></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
No spaces.
In response to the question, is it possible I got lucky? Tested again, various content and table column widths. Content that I am showing likely is kerned and of various lengths and I varied the size of the table cells. In all cases there is no gap.
I tested a few others things and realize the difference is the formatter. Apache FOP and Antennahouse yield the issue you have shown, I was using RenderX XEP (whom I work for). It does not exhibit this behavior. IMHO, the correct answer is no spaces if your formatter has the algorithms for allowing inter-character and word space squeezing to fit within an allowable tolerance. Justified is "justified".

I think there are two reasons for the strange "gap" between the two series of dots on each table row:
the column is not an exact multiple of the leader pattern (dot + space); for example, supposing a dot and a space are 3 mm wide and the empty area to be filled by the fo:leader has a width of 17 mm, the formatter can only insert 5 dots, leaving an extra gap of 2 mm
the dots on different rows are not aligned; each series of dots in the left column starts rigth from the end of the preceding text, so the gap depends also on the text length
Solution:
use leader-alignment="reference-area" (which XSLFormatter supports)
set a leader-pattern-width, and set the table width to a multiple of that

Related

is vertical alignment with images in bootstrap 5 handled differently to text, buttons or other components?

I've run into some issues with vertical alignment for an image (using bootstrap 5).
In the index.html I've created a number of thick strips that alternate being colour and then white, with each about 800 px each. I've set the height of each strip in css to 800px.
I'm trying to place an image in each strip and the image sizes will differ in width but none will be greater than 800 px in height. The image doesn't seem to be vertically centred when I used the suggestions from the post below:
Bootstrap Center Vertical and Horizontal Alignment
There is this example given https://www.codeply.com/p/0VM5MJ7Had
And the div tag used to center everything is
<div class="d-flex flex-column min-vh-100 justify-content-center align-items-center">
In the tag above if the min-vh-100 is removed then the content just moves up to the top of the screen even though it's still justify-content-center and align-items-center.
I'm still struggling to get my head around how vertical alignment works and the relationship between containers and rows to aligning an image vertically.
<!-- color background -->
<div id="first_strip" >
<img src="../images/" class="img-fluid" alt="" />
</div>
<!-- white background -->
<div id="second_strip">
<img src="../images/" class="img-fluid" alt="" />
</div>
<!-- color background -->
<div id="third_strip" >
<img src="../images/" class="img-fluid" alt="" />
</div>
etc.

SVG fill color change after resize make the svg invisible

I have an inline svg with a filter applied to it for shadow effect on the right and buttom of the SVG .
<div id="d78" class="drag" style="width: 52px; margin: 0 auto;">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 138 138" >
<defs>
<filter id="blurFilter2" y="-10" height="40" x="-10" width="150">
<feOffset in="SourceAlpha" dx="3" dy="3" result="offset2"></feOffset>
<feGaussianBlur in="offset2" stdDeviation="3" result="blur2">/feGaussianBlur>
<feMerge>
<feMergeNode in="blur2"></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
</defs>
<rect class="rrfNode" fill="#4B4F54" x="0" y="0" width="130" height="130" style="filter: url(#blurFilter2); " />
</svg>
The container div is draggable and resizeable through jquery UI plugin . The container div has a color picker icon attached to it which when clicked displays the color palette and on choosing any color the svg rect changes to that particular color for which I have written some jquery .
Now when I resize the svg and then try to use the color picker to change color of the svg rect , the svg just disappears from view even though I can see that the svg color is getting set when I inspect the element in the Chrome browser .
The jquery code to change color is :
$(document).on('changeColor','.fa-eyedropper',function(e) {
$(this).parents(".ui-draggable").find(".rrfNode").css({ fill: color.toHex()});
});
The invisible svg reappears again after I resize the svg .
When I delete the filter this problem gets resolved . But I need to keep both the resize and the color picker along with the filter .
I suspect that it is a problem with the filter , but I cannot figure that out . After searching and trying to solve this bug for 2 days I am posing this question . Please help .
Found out the reason behind this strange behaviour . The filter id in all the svg images were the same so any change to any of the svgs would result in the shadows of other svg images disappearing along with the content of the images, in effect the image will disappear. I changed the filter ids for the svg images , such that all svgs have unique filter ids and that has solved my problem . It was a very silly mistake on my part.

FOP table with cell having two blocks top and bottom aligned

I would like to generate a table like the one in the image below using FOP:
Left column can have 1 or any number of rows.
Block1 and Block2 in right column can have 1 or any number of lines. I want Block1 to be top aligned and Block2 to be bottom aligned.
For the right column I tried this:
<fo:table-cell number-rows-spanned="$rows-spanned" display-align="after">
<fo:block>
Block1 Lorem ipsum
</fo:block>
<fo:block>
Block2 Lorem ipsum bla aaaa
</fo:block>
</fo:table-cell>
but it aligns Block1 and Block2 to the bottom.
Any idea how to achieve the desired output?
(disclosure: I'm a FOP developer, though not very active nowadays)
After some pondering, I've thought of two possible solutions.
Solution 1 (recommended): using two spanning cells
Instead of spanning all the rows with a single cell containing both blocks, span just half the rows with a cell containing Block 1, and then use another row-spanning cell with display-align="after" for Block 2:
<fo:table width="100%" table-layout="fixed">
<fo:table-column column-width="50%"/>
<fo:table-column column-width="50%"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid #000000">
<fo:block>header</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid #000000" border-bottom="none" number-rows-spanned="6">
<fo:block color="red">Block 1 Lorem ipsum</fo:block>
</fo:table-cell>
</fo:table-row>
<!-- ... 5 more rows ... -->
<fo:table-row>
<fo:table-cell border="1pt solid #000000">
<fo:block>item 6</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid #000000" border-top="none" number-rows-spanned="5" display-align="after">
<fo:block color="blue">Block 2 Lorem ipsum bla aaaa</fo:block>
</fo:table-cell>
</fo:table-row>
<!-- ... the remaining 4 rows ... -->
</fo:table-body>
</fo:table>
Pros:
cleaner solution
no overlapping problems if there are few rows and the text blocks are several lines long
Cons:
the stylesheet to produce this would be more complicated (you have got to produce two row-spanning cells in the right row, taking into account that the number of rows could be odd / even)
Solution 2: using an extra column and margin tricks
You can define the table to have 3 columns, put Block 1 in a cell spanning all rows in column #2 and Block 2 spanning all rows in column #3, and creatively use margins to "move" Block 2 in the desired location:
<fo:table width="12cm" table-layout="fixed">
<fo:table-column column-width="4cm"/>
<fo:table-column column-width="4cm"/>
<fo:table-column column-width="4cm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid #000000">
<fo:block>header</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid #000000" number-rows-spanned="11">
<fo:block color="red">Block 1 Lorem ipsum</fo:block>
</fo:table-cell>
<fo:table-cell number-rows-spanned="11" display-align="after">
<!-- use margins to "push" the block in the previous column -->
<fo:block margin-left="-4cm" margin-right="4cm" color="blue">Block 2 Lorem ipsum bla aaaa</fo:block>
</fo:table-cell>
</fo:table-row>
<!-- ... the other 10 rows ... -->
</fo:table-body>
</fo:table>
Pro:
simpler template to produce this, as you have to care about column #2 and #3 in the first row only
Cons:
if there are few rows and long blocks of text, they could overlap
should the table have a page break inside it, both text would appear on the first page (as they are both in the first row)
this is probably a dirty trick, so I would not recommend doing this (I tested it with FOP 1.1 and 2.0 and it works, with an INFO message about the table being larger than the available space)
If you know height you can do this simply
<fo:table-cell text-align="left" height="5cm">
<fo:block>
<fo:block-container height="25mm">
<fo:block xsl:use-attribute-sets="myBorder">
Block1 Lorem ipsum
</fo:block>
</fo:block-container>
<fo:block-container height="25mm" xsl:use-attribute-sets="myBorder" display-align="after">
<fo:block xsl:use-attribute-sets="myBorder" vertical-align="bottom" display-align="after">
Lorem ipsum bla aaaa
</fo:block>
</fo:block-container>
</fo:block>

mathml on iOS -- mtable row spacing

This is driving me crazy. I need spacing between the rows of my mtable elements. For now, I am content to get it in the html; once I have that working, I'll try to move it to CSS.
Here are some things I am trying. In each case, I've set the amount of space crazy large so that if it works it will be unmistakable. But so far I can't see any space.
The implementation of mathML is incomplete. But until now, I've been able to find work-arounds for almost everything.
<math>
<mtable rowspacing="10ex">
<mtr padding="40px">
<mtd padding="40px">
<!-- remainder of the table here -->
another attempt, equally useless:
<math>
<mtable framespacing="40px 40px">
<mtr margin="40px">
<mtd margin="40px">
<!-- remainder of the table here -->
This did it:
<mtd style="padding:10px 0 10px 0">

How do I stop iOS from converting a small pointing right triangle character into a rectangluar boxed triangle symbol?

I've tried entering the small pointing right triangle and the right arrow characters, both are converted by iOS into rectangular icons with a right triangle and a right arrow, respectively. Can I declare a different font to stop this from happening? Or is there a default setting I need to turn off?
All a want is a black small pointing right triangle:
Decimal Hex
▸ 9656 ▸ 25B8
Here is the Code:
NSString *title = [NSString stringWithFormat:#"%d payments of %# ➡ ▶", duration, [Utils formatPrice:payment]];
[button setTitle: title forState: UIControlStateNormal];
Any suggestions would be appreciated.
This is not about changing font, but about unicode variation.
On Unicode 6.1, one unicode code point can have multiple glyphs, and you can choose those using Variation Selectors.
For about emoji, you can use U+FE0E(#"\U0000FE0E") to choose text style graph.
(And, U+FE0F(#"\U0000FE0F") is for Apple Color Emoji).
For example, LEFT-POINTING TRIANGLE's unicode code point is U+25C0(#"\U000025C0"), and you can specify not to use Apple Color Emoji but non-color symbol like #"\U000025C0\U0000FE0E".
Also, there is some difference between iOS emulator(for iOS6 on Mountain Lion) and actual device(iOS6) about Variation Selector handling, probably because Mountain Lion have more support for Unicode 6.1, I guess.
For example, if I don't specify the selectors, I see non-color triangle on iOS6 device, but Apple Color triangle on iOS6 simulator(on Mountain Lion), for UIBarButton.
So, it is nice to check both simulator and actual device, but it looks more safe to use Unicode Variation Selectors always anyway.
It was kind of challenging to force the Browser to render the HTML Entity on iPads/iPhones, but I managed to find the solution, and here's the trick.
Instead of using HTML entities directly:
◀ <!-- ◀ BLACK LEFT-POINTING TRIANGLE -->
▶ <!-- ▶ BLACK RIGHT-POINTING TRIANGLE -->
I created supportive elements in HTML, with the classes:
<span class="left-pointing-triangle"> </span>
<span class="right-pointing-triangle"> </span>
With the use of CSS ::after pseudo-element made the override of the content:
.left-pointing-triangle::after {
content: "\25C0 \FE0E";
}
.right-pointing-triangle::after {
content: "\25B6 \FE0E";
}
The important part is to use content: "\25C0 \FE0E", instead of just symbol itself content: "\25C0". It works flawlessly on both iPads and iPhones of different iOS versions.
I use these unicode characters to stop iOS from fiddling:
Right-triangle: ► (&#x25ba)
Left-triangle: ◄ (&#x25c4)
Update
If further triangles are what you seek:
Up-triangle: ▲ (&#x25b2)
Down-triangle: ▼ (&#x25bc)
To show the black right arrow emoji, we should choose ▸ instead of ▶ or ► in order to avoid Apple Emoji
▸ is smaller than the other two, but you can set the font-size to adjust it.
Works for me.
You can render small triangles in SVG on modern browsers.
Right Triangle:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="8" height="16" viewBox="0 0 5 10">
<polygon fill="black" points="0,0 5,5 0,10" />
</svg>
Left Triangle:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="8" height="16" viewBox="0 0 5 10">
<polygon fill="black" points="0,5 5,0 5,10" />
</svg>
That appears to be the system font glyph for 25B8. I would assume the same would happen for 2B05 (Leftwards Black Arrow) and 25C0 (Black Left-Pointing Triangle). They are apart of Apple Emoji.
You may want to try using a different font.
Hope that helps.

Resources