IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#57596 - 07/24/20 01:32 PM need help with upper scrip
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 400
Loc: Home
happy Friday all,

Can someone help me how to print French upper script

Example I need to print "ier" and "eme" in upper script
1ier Juillet 2020
22eme Jullet 2020

Thank you
_________________________
Peace

Top
#57597 - 07/27/20 07:53 AM Re: need help with upper scrip [Re: Sami786]
jim3108 Offline
OL Expert

Registered: 04/19/10
Posts: 316
Loc: London, UK
If you want to make anything uppercase in Design, use the uppercase function which is available here: Click here.

However in your case, you could just target the 'ier' and 'eme' with stringreplace as follows:

Code:
=stringreplace(&MyVar, 'eme', 'EME')

Let us know how you get on.

Regards,

James.

Top
#57598 - 07/27/20 04:14 PM Re: need help with upper scrip [Re: Sami786]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 400
Loc: Home
Hi Jim,

What I need is not upper case, I need to print the 1(ier) in small font and a little upper as Cardinal date.

Example “Le 1ier juin 1943”.

22nd April 2020 the (nd) should be printed in small script font and upper.
_________________________
Peace

Top
#57599 - 07/27/20 06:44 PM Re: need help with upper scrip [Re: Sami786]
jim3108 Offline
OL Expert

Registered: 04/19/10
Posts: 316
Loc: London, UK
I believe you are referring to superscript.

Please refer to Raphael's post here.

Top
#57602 - 07/29/20 03:58 PM Re: need help with upper scrip [Re: Sami786]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 400
Loc: Home
I tried Raphael's post but it's not wrapping for me

I created the function as below:
function @Superscript(&super:string, &x:measure, &y:measure)
SetStyle(&Helvetica6)
moveto(&x, &y - 0.06)
show(&super)
moveto(&x, &y)
endfunction()

----------------------
Then I used a Text object and copied below Prestalk code


setstyle(&Default)
beginparagraph(0,6,0,'left',0.1598)
show(trim(@(12,1,2)))
endparagraph

@SuperScript('ier', &current.x, &current.y)
setstyle(&Default)
rmoveto(0, -0.1598)

beginparagraph(0,6,&current.x,'left',0.1598)
show(trim(@(12,3,20)))
endparagraph

The idea was to split the date in two blocks of code, and call the superscript function in between, and use & current.x as the first indentation of the second paragraph. I tested this code with both Helvetica but it's not wrapping, the superscript (ier) is static and not wrapping correctly.

I need to print
1ierjuin 1973
29iemejuin 2020




Edited by Sami786 (07/29/20 04:01 PM)
_________________________
Peace

Top
#57603 - 07/30/20 09:51 AM Re: need help with upper scrip [Re: Sami786]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
You were close. There are two tricks here:
  • Your second paragraph must be moved up by one line because a paragraph always starts on a new line.
  • The second paragraph must have the same properties as the first one with the exception of its first indent property, which must be set to the current X position.

  • beginparagraph(0,3,0,'left',0.1598)
      setstyle(&Style1)
      show('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat 1')
    endparagraph
    
    @SuperScript('ier')
    
    %% MOVE UP ONE LINE BEFORE THE NEXT PARAGRAPH
    rmoveto(0,-0.16)
    
    %% SET FIRST INDENT TO &current.x
    beginparagraph(0,3,&current.x,'left',0.1598)
      setstyle(&Style1)
      show(' juin 1973 aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.')
    endparagraph
    
    setstyle(&Style1)
    

Note that you SuperScript function should be simplified since it doesn't require any X,Y parameters:

    function @SuperScript(&sp:string)
      rmoveto(0,-0.06)
      setstyle(&Super)
      show(&sp)
      rmoveto(0,0.06)
    endfunction()
    
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#57615 - 08/03/20 10:03 PM Re: need help with upper scrip [Re: Sami786]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 400
Loc: Home
it's printing correctly if there's one digit

1ierjuin 1973 prints correctly

29iemejuin 2020 print incorrectly it's not wrapping correctly when two digits!
_________________________
Peace

Top
#57617 - 08/04/20 07:26 AM Re: need help with upper scrip [Re: Sami786]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
I just tested the script again with several different values (even ludicrous ones like "2439 juillet 2020"!) and it still works just fine.

When you say it doesn't "wrap" properly, do you mean that the entire date remains on the same line? Are you sure you are adding spaces before and after each part of the date? (without spaces, the text cannot wrap properly).
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#57632 - 08/20/20 01:26 PM Re: need help with upper scrip [Re: Sami786]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 400
Loc: Home
Thank you, it's working by adding the space smile
_________________________
Peace

Top