Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compose Tibetan Buddhist Canon text collection in layout of traditional Pecha tibetan texts #1785

Closed
RimeOCRLIB opened this issue Dec 25, 2022 · 8 comments

Comments

@RimeOCRLIB
Copy link

RimeOCRLIB commented Dec 25, 2022

Good day.

Thank you for all your noble work for benefit of all mankind.

At present we need compose Tibetan Buddhist Canon text collection in layout of traditional Pecha tibetan texts. At first stage it is about 350 volumes.

https://www.pechamaker.com/screenshots.html
https://en.wikipedia.org/wiki/Pecha

Does it possible to ask your help to compose this layout and help me understand how adjust hyphenation route for tibetan texts? First of all we need position @left-middle and @right-middle properly and make border around all page content.

@page :left {
  margin: 5mm 35mm 5mm 35mm;
  border: 1px solid black;
  padding:3px;
  @left-middle { display: inline-block; margin-left:-60px; padding:3px; width:200px; height:30px; border:1px solid black; transform: rotate(90deg);  content: "ris" }
  @right-middle {display: inline-block; margin-right:-60px;  padding:3px; width:200px; height:30px; border:1px solid black; transform: rotate(-90deg); content: counter(page); font-variant: small-caps }
}

pecha
Screenshot from 2022-12-25 20-24-00
Of course we will be happy provide Weasyprint contact an every generated PDF (at last few million pages).

Open Source Buddhism Library
Stroganov Alexander

@RimeOCRLIB
Copy link
Author

We put SVG background for whole page and it solve layout partly.
But we was not able to position vertical text correctly on both sides of page.
@left-top @left-middle it is only area position without opportunity to set absolute location.

Any chance set @left-middle as DIV or SPAN and absolute position it by CSS or Python code?
Any advice will be really appreciated.

@RimeOCRLIB
Copy link
Author

Result we have for now.
tibetan pagination

@RimeOCRLIB
Copy link
Author

RimeOCRLIB commented Dec 27, 2022

@left-top @left-middle it is only area position without opportunity to set absolute location.
Position text by line-height:1px; margin and padding give as some result by not for all pecha layouts.

 @left-top {   
     width:200px;
     font-size: 11pt;
     content: string(heading);
     transform: rotate(90deg);
     line-height:1px;
     padding-top:0px;
  }

Any chance set @left-middle as DIV or SPAN and set absolute position of it by CSS or Python code?
Any advice will be really appreciated.

@liZe
Copy link
Member

liZe commented Dec 27, 2022

Good day.

Hi!

Thank you for all your noble work for benefit of all mankind.

🙏️

Does it possible to ask your help to compose this layout

As this seems to be quite complex, it would be really useful to get an example. Could you please provide a "simple" example with an image of what you want (it could be a screenshot of PechaMaker) and the corresponding HTML/CSS sample you have?

and help me understand how adjust hyphenation route for tibetan texts?

Hyphenation is done using the Pyphen library (that we also maintain) and Hunspell hyphenation dictionaries. We currently use the ones provided by LibreOffice, but no Tibetan hyphenation dictionary is provided yet.

Depending on the Tibetan hyphenation rules, it can be quite easy (but long) or extremely hard (and extremely long) to write such a dictionary. Maybe one is already available somewhere?

@RimeOCRLIB
Copy link
Author

RimeOCRLIB commented Dec 27, 2022

Good day!
Thank you for kind attitude and good will to help in Tibetan typography development.

Tibetan hyphenation and pagination rules is relatively simple and need implement only few rules for all texts.

  1. In Tibetan words is short and separates by ་ sign. Phrases limited by spaces and addition punctuation.
    Words have no hyphenation and have no breaks.
  2. All text on odd pages start from ༄༅།། ། sign in first text line. This sign may have some different form but rule always put it in the beginning of the odd pages text.
  3. All words in phrase separated by ་ sign. Words have no hyphenation break. This work well already. Look like HTML render engine use this rule.
  4. If text line start from end of previous line phrase and this end of phrase have only one syllables, end of phrase sign ། change to ༑ sign. Look in attachment
  5. It is also some rules how phrases need to be render in proper way between text lines and pages. (Not start new phrase on last line of page if it have room for one syllables only and few another rules. Horizontal line after chapter end will be really nice.)

This rules more about how handle phrases and syllables on page than pure hyphenation rules.
Does Python code of Weasyprint have access to phrase rendering rules?

tibetan hyphenation

@RimeOCRLIB
Copy link
Author

RimeOCRLIB commented Dec 27, 2022

As this seems to be quite complex, it would be really useful to get an example. Could you please provide a "simple" example with an image of what you want (it could be a screenshot of PechaMaker) and the corresponding HTML/CSS sample you have?

We my use @left-middle rule in @page for position of header text vertically. Problem is we can not position it by relative or absolute coordinate.

@left-top {
width:200px;
font-size: 11pt;
content: string(heading);
transform: rotate(90deg);
line-height:1px;
padding-top:0px;
}

transform: rotate(90deg);
move text line in unpredictable position and

     line-height:1px;
     padding-top:0px;

move text line the way we can not predict in code. In tibetan text sometimes it is need position two or three headers.

Screenshot from 2022-12-27 19-30-46
pecha.zip

@liZe
Copy link
Member

liZe commented Dec 27, 2022

Thanks for your sample.

I’m sorry, but it’s difficult for me to fully understand what is the problem with your current implementation. Could it be possible to have an HTML/CSS sample and an image of the same content, so that we can compare the generated PDF with the image and see what’s wrong?

@RimeOCRLIB
Copy link
Author

RimeOCRLIB commented Dec 27, 2022

Great.
Here it is example of one page.
Footer and headed need print in two line with different content.
For example right footer need page number and Author Name
Left header need Chapter Name and Volume Number (as tibetan letter)
page_example

For now we have this result.
Screenshot from 2022-12-28 01-09-33

@left-top {   
   width:200px;
   font-size: 11pt;
   content: string(heading);
   transform: rotate(90deg);
   line-height:20px;
   padding-top:0px;
}
@right-top { 
   width:200px;
   font-size: 11pt;
   transform: rotate(-90deg);
   line-height:20px;
   content:counter(page) " <br/>? Volume number and name on new line";  
}

pecha_page.zip

HTML tag br/ position and another tag not working in content:

How we may manage header as two lines and position them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants