gbv / SignaturenDruck

An electron application to print shelfmarks onto labels
https://verbundwiki.gbv.de/display/VZG/SignaturenDruck+der+ThULB+Jena
Creative Commons Zero v1.0 Universal
3 stars 2 forks source link

New problems with the printer #63

Closed The-Ridder-HS closed 5 years ago

The-Ridder-HS commented 5 years ago

Good afternoon, We have again problems with the RegEx adjustments this time for large signatures.

The signature would be:

PDJ 33 380/1949-1947

These signatures can also be longer.

Would they give us guidance on the regex settings?

EliDeh commented 5 years ago

Could you give me the number of lines and an example for the desired output? Like: Number of Lines: 4

1: PDJ 2: 33 3: 4: 380/1949-1947

Could signatures contain any special characters like $%& ?

The-Ridder-HS commented 5 years ago

Could you give me the number of lines and an example of the desired output?

Yes i can : An example is : PDJ 35 380 / 1949-1974 Maximum of 2 lines Line 1: PDJ 35 380 Line 2: 1947-1974

Number of lines:

Maximum 2

Could signatures contain special characters such as $%&?

No only /()+-_*


German


Könnten Sie mir die Anzahl der Zeilen und ein Beispiel für die gewünschte Ausgabe geben? Ein Beispiel ist: PDJ 35 380 / 1949-1974 Maximal 2 Zeilen Zeile 1: PDJ 35 380 Zeile 2: 1947-1974

Anzahl der Zeilen: Maximal 2 Könnten Signaturen Sonderzeichen wie $%& enthalten? Nein nur /()+-_*

EliDeh commented 5 years ago

Is the linebreak always after the /?

The-Ridder-HS commented 5 years ago

Oh! For small signatures not. But that works already.

In the case of the large signatures, if they do not fit to 70 mm x 20 mm in a single line, the annual numbers or editions should then be placed in a second line, which is then behind the /

EliDeh commented 5 years ago

Ok. In that case, the RegEx: ^(.*)[/](.*)$ should be fine. I attached the Modi\defaultMode.json, Formate\default_gross.json and FormateCSS\default_gross.css.

default_EDITED.zip

The-Ridder-HS commented 5 years ago

Fixed, after the changes, I can also display the major signage on small signatures, or larger ones as it fits and here at the location better. I thank them once again for the quick fix.

Is there a way to learn how we can make small adjustments ourselves? Because the wiki doesn't contain everything as exactly as you change things in RegEx.

EliDeh commented 5 years ago

You're welcome. I can recommend this website to test regular expressions and to deepen the understanding. RegExr

The-Ridder-HS commented 5 years ago

We have a small problem still how to do after the first 6 letters e.g. IHZ-UH insert a distance 3 characters ? The text then, for example This is how it looks: IHZ-UH___283 288/ 1985-2019. The underscores should be the distance.

EliDeh commented 5 years ago

Ok, for the default_klein: Change the RegEx, from: ^([\w\-]+\s[\w\.\,]+)([\s\/]?)([^\/\:]*)([\/\:]?)(.*)$ to: ^([\w\-]+\s)([\w\.\,]+)([\s\/]?)([^\/\:]*)([\/\:]?)(.*)$

and edit the line grouping, from: $1$2$3$4$5$6 to: $1   $2$3$4$5$6

For the default_gross: Change the RegEx, from: ^(.*)[/](.*)$ to: ^([\w\-]+\s)([\w\.\,]+)(.*)[/](.*)$

and edit the line grouping, from: $1 $2 to: $1   $2$3 $4

The-Ridder-HS commented 5 years ago

Thank you very much. Now it's perfect. Thank you for the super-fast support

EliDeh commented 5 years ago

You're welcome. Currently the results will be 4 white spaces instead of 3. To correct this, you have to change the RegEx, default_gross: from: ^([\w\-]+\s)([\w\.\,]+)(.*)[/](.*)$ to: ^([\w\-]+)\s([\w\.\,]+)(.*)[/](.*)$

default_klein: from: ^([\w\-]+\s)([\w\.\,]+)([\s\/]?)([^\/\:]*)([\/\:]?)(.*)$ to: ^([\w\-]+)\s([\w\.\,]+)([\s\/]?)([^\/\:]*)([\/\:]?)(.*)$