Textshaping exists partly to allow all the various scripts that exists in the world to be used in R graphics. This function returns gibberish filler text (lorem ipsum text) in various scripts for testing purpose. Some of these are transliterations of the original lorem ipsum text while others are based an a distribution model.
lorem_text(
script = c("latin", "chinese", "arabic", "devanagari", "cyrillic", "kana", "hangul",
"greek", "hebrew", "armenian", "georgian"),
n = 1
)
lorem_bidi(
ltr = c("latin", "chinese", "devanagari", "cyrillic", "kana", "hangul", "greek",
"armenian", "georgian"),
rtl = c("arabic", "hebrew"),
ltr_prop = 0.9,
n = 1
)
A string giving the script to fetch gibberish for
The number of paragraphs to fetch. Each paragraph will be its own element in the returned character vector.
scripts to use for left-to-right and right-to-left text
The approximate proportion of left-to-right text in the final string
a charactor vector of length n
https://generator.lorem-ipsum.info
# Defaults to standard lorem ipsum
lorem_text()
#> [1] "Lorem ipsum dolor sit amet, et vidisse accusata conclusionemque qui. Saepe euripidis ea cum. Liber urbanitas ex eum. Rebum pericula cu per. Nec quod tritani at. Congue munere dictas at qui, ne elaboraret appellantur quo, pro id dolorum splendide aliquando. Per ne errem omittantur conclusionemque."
# Get two paragraphs of hangul (Korean)
lorem_text("hangul", 2)
#> [1] "탄핵소추의 의결을 받은 자는 탄핵심판이 있을 때까지 그 권한행사가 정지된다. 국무총리 또는 국무위원이 출석요구를 받은 때에는 국무위원 또는 정부위원으로 하여금 출석·답변하게 할 수 있다, 대통령후보자가 1인일 때에는 그 득표수가 선거권자 총수의 3분의 1 이상이 아니면 대통령으로 당선될 수 없다. 교육의 자주성·전문성·정치적 중립성 및 대학의 자율성은 법률이 정하는 바에 의하여 보장된다."
#> [2] "대통령이 궐위되거나 사고로 인하여 직무를 수행할 수 없을 때에는 국무총리, 사형을 선고한 경우에는 그러하지 아니하다. 모든 국민의 재산권은 보장된다. 모든 국민은 법률이 정하는 바에 의하여 선거권을 가진다."
# Get gibberish bi-directional text
lorem_bidi()
#> [1] "Lorem ipsum dolor sit بـ amet, et vidisse accusata conclusionemque qui. Saepe euripidis جُل ea cum. Liber urbanitas ex eum. Rebum pericula cu per. Nec quod tritani at. Congue munere dictas at qui, وحتى ne elaboraret appellantur quo, pro id المتّبعة. dolorum حيث splendide aliquando. Per ne errem omittantur conclusionemque."