change value to text in cell element

This commit is contained in:
Jörg Prante 2023-08-09 18:20:15 +02:00
parent ddb5db7b84
commit 8475f64388
3 changed files with 16 additions and 16 deletions

View file

@ -1,5 +1,5 @@
group = org.xbib.graphics
name = graphics
version = 4.5.0
version = 4.5.1
org.gradle.warning.mode = ALL

View file

@ -27,7 +27,7 @@ public class CellCommand implements Command {
@Override
public void execute(Engine engine, State state, Settings settings) throws IOException {
if (settings.containsSetting("value")) {
if (settings.containsSetting("text")) {
TextCell.Builder cell = TextCell.builder();
if (settings.containsSetting("padding")) {
String padding = settings.get("padding", "0 0 0 0");
@ -38,7 +38,7 @@ public class CellCommand implements Command {
float paddingBottom = Float.parseFloat(paddings[3]);
cell.padding(paddingLeft, paddingRight, paddingTop, paddingBottom);
}
cell.text(settings.get("value"));
cell.text(settings.get("text"));
cell.fontSize(settings.getAsFloat("fontsize", 11.0f));
Document document = state.getDocument();
Font font = document.getFont(settings.get("font", "helvetica").toUpperCase(Locale.ROOT));

View file

@ -128,15 +128,15 @@
"elements": [
{
"type": "cell",
"value": "Cell A"
"text": "Cell A"
},
{
"type": "cell",
"value": "Cell B"
"text": "Cell B"
},
{
"type": "cell",
"value": "Cell C"
"text": "Cell C"
}
]
},
@ -145,15 +145,15 @@
"elements": [
{
"type": "cell",
"value": "Cell D"
"text": "Cell D"
},
{
"type": "cell",
"value": "Cell E"
"text": "Cell E"
},
{
"type": "cell",
"value": "Cell F"
"text": "Cell F"
}
]
}
@ -168,15 +168,15 @@
"elements": [
{
"type": "cell",
"value": "Cell 1"
"text": "Cell 1"
},
{
"type": "cell",
"value": "Cell 2"
"text": "Cell 2"
},
{
"type": "cell",
"value": "Cell 3"
"text": "Cell 3"
}
]
},
@ -185,19 +185,19 @@
"elements": [
{
"type": "cell",
"value": "Cell 4",
"text": "Cell 4",
"padding": "5 5 5 5",
"borderwidth": 0.5
},
{
"type": "cell",
"value": "Cell 5",
"text": "Cell 5",
"padding": "5 5 5 5",
"borderwidth": 0.5
},
{
"type": "cell",
"value": "Cell 6",
"text": "Cell 6",
"padding": "5 5 5 5",
"borderwidth": 0.5
}
@ -210,7 +210,7 @@
"elements": [
{
"type": "text",
"value": "Hello World 6",
"text": "Hello World 6",
"fontsize": 20,
"font": "notosans"
}