Recent

Author Topic: Displaying Arabic on Console  (Read 3383 times)

pascal111

  • Sr. Member
  • ****
  • Posts: 282
  • Un trabajo en equipo para programas serias.
Re: Displaying Arabic on Console
« Reply #15 on: May 12, 2021, 12:59:28 am »
Usually a problem similar to yours is going to be caused by one of two possible reasons:
1-Wrong code page.
2-A font that does not include the correct glyphs.

This is logical and not related to the OS, Windows or Linux.

The same way you assumed I have the solution, I also assumed you know how to change the font, or at least to look it up and learn how to do that.

بغض النّظر عمّا حدث فالآن تكلّمت كلاماً به فن ،لا بأس ،إنسى ما حدث ،سوف أبحث عن حل لتغيير الخط في بيئة Lazarus وسأنتظر كذلكـ مُساهمة أحد الأعضاء في ذلكـ وإن لم أصل إلى نتيجة فيُمكنني تناسي موضوع هذه الصفحة الإلكترونيّة فلن يكون تأثير نقصه مُعضلاً غير أنّنا لو عرفنا الحل فسيكون ذلكـ إضافة جيّدة.

google translate:

"Regardless of what happened, now I "You" have spoken a words about it, "have" art, it is okay, forget what happened, I will look for a solution to change the line "font" in the Lazarus environment and I will wait as well - the contribution of one of the members in that. "and if I didn't reach to a result I can forget the topic of this electronic page for its minus won't affect much" "but" If we knew the solution, that would be a good plus."

pascal111

  • Sr. Member
  • ****
  • Posts: 282
  • Un trabajo en equipo para programas serias.
Re: Displaying Arabic on Console
« Reply #16 on: May 12, 2021, 01:01:22 am »
Which distribution of Linux are you using?
I just did a quick search and changing the font seems fairly easy.

Linux Mint

engkin

  • Hero Member
  • *****
  • Posts: 2812
Re: Displaying Arabic on Console
« Reply #17 on: May 12, 2021, 01:12:57 am »
When.it comes to programming, there is no sensitivity. If I say something wrong, I don't mind getting corrected. It could seem harsh or not that polite, but it is not. The point is to pass information to the second party.

In your previous reply you said:
Quote
I will look for a solution to change the line "font" in the Lazarus environment

In a terminal/console application, Lazarus has nothing to do with the font. It is a Linux setting. This is unlike GUI applications where you can control the font.

The summary here, use search terms like "linux change terminal font"

engkin

  • Hero Member
  • *****
  • Posts: 2812
Re: Displaying Arabic on Console
« Reply #18 on: May 12, 2021, 01:16:13 am »
Which distribution of Linux are you using?
I just did a quick search and changing the font seems fairly easy.

Linux Mint

Would it be possible to try this:
 https://forums.linuxmint.com/viewtopic.php?t=184660

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 535
  • Professional amateur ;-P
Re: Displaying Arabic on Console
« Reply #19 on: May 12, 2021, 08:25:59 am »
Hey all,

Most of the console/terminal/command line applications in Linux use a Monospaced Font.
تستخدم معظم تطبيقات سطر الأوامر / الوحدة الطرفية / الأوامر في Linux الخط أحادي المسافة.

This may be problematic if the Arabic symbols cannot be represented in a Monospaced Font.
قد يكون هذا مشكلة إذا كان لا يمكن تمثيل الرموز العربية في خط أحادي المسافة.

The Arabic written language is full of ligatures that could pose issues when applied to a Monospaced Font.
تمتلئ اللغة العربية المكتوبة بالأحرف المركبة التي يمكن أن تثير مشاكل عند تطبيقها على خط أحادي المسافة.

Also the Right To Left doesn't help...
كما أن اليمين إلى اليسار لا يساعد ...

But if the Lazarus TSynEdit is able to display the Arabic, then there's hope, since the editor is also using a Monospaced font.
ولكن إذا كان Lazarus TSynEdit قادرًا على عرض اللغة العربية ، فهناك أمل ، لأن المحرر يستخدم أيضًا خطًا أحادي المسافة.

@Pascal111: Can I ask you if you could report back with 2 things?:
هل يمكنني أن أسألك عما إذا كان بإمكانك الإبلاغ عن شيئين؟
  • The font name and size you're using on Lazarus
    اسم الخط وحجمه اللذين تستخدمهما في Lazarus
  • The font name and size that you're using in your console/terminal/command line app.
    اسم الخط وحجمه الذي تستخدمه في تطبيق سطر الأوامر / وحدة التحكم / المحطة / الأوامر.
    You can find it on the Setup or Settings or Configure area.
    يمكنك العثور عليه في منطقة الإعداد أو الإعدادات أو التكوين.

Many thanks !!

Cheers,
Gus

PS: I hope the Google Translate didn't offend Pascal111 with it's interpretation of the English and the technical!!
ملاحظة: آمل ألا تسيء ترجمة Google إلى Pascal111 بتفسيرها للغة الإنجليزية والتقنية !!
« Last Edit: May 12, 2021, 08:34:57 am by Gustavo 'Gus' Carreno »
Lazarus 2.1.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

pascal111

  • Sr. Member
  • ****
  • Posts: 282
  • Un trabajo en equipo para programas serias.
Re: Displaying Arabic on Console
« Reply #20 on: May 12, 2021, 02:16:43 pm »
When.it comes to programming, there is no sensitivity. If I say something wrong, I don't mind getting corrected. It could seem harsh or not that polite, but it is not. The point is to pass information to the second party.

ليس من قسوةٍ كما تفضّلت في تصويب الغير للشخص في تعليم البرمجة إن كان الشخص مُخطأً ﻷنّ هذا يخدم تعليم هذا الفن والعلم الراقي الحديث ويؤدّي إلى نشره للإرتقاء بالعقول والأذواق ولكنّ الأهم النيّة التعليميّة ألّا تكون مُضلّلة ومُسببة للعجز.

google translate:

"There is no cruelty as I "you" preferred "granted" in correcting others for the person in teaching programming if the person is wrong, because this serves the teaching of this modern art and science and leads to spreading it to raise minds and tastes, but the most important "is that the " educational intention is not to be misleading and incapacitating."

In your previous reply you said:
Quote
I will look for a solution to change the line "font" in the Lazarus environment

In a terminal/console application, Lazarus has nothing to do with the font. It is a Linux setting. This is unlike GUI applications where you can control the font.

The summary here, use search terms like "linux change terminal font"

أرى الأمر الآن ،ليس الأمر من إختصاص بيئة Lazarus.

google translate:

"Now I see it, it's not in Lazarus' environment."

Which distribution of Linux are you using?
I just did a quick search and changing the font seems fairly easy.

Linux Mint

Would it be possible to try this:
 https://forums.linuxmint.com/viewtopic.php?t=184660

إتّبعت الخطوات كما في الرابط الذي زوّدتني به وكان الخط هو Monospace Regular 12.

google translate:

"I followed the steps as in the link you gave me and the font was Monospace Regular 12."

pascal111

  • Sr. Member
  • ****
  • Posts: 282
  • Un trabajo en equipo para programas serias.
Re: Displaying Arabic on Console
« Reply #21 on: May 12, 2021, 05:07:42 pm »
Hey all,

Most of the console/terminal/command line applications in Linux use a Monospaced Font.
تستخدم معظم تطبيقات سطر الأوامر / الوحدة الطرفية / الأوامر في Linux الخط أحادي المسافة.

This may be problematic if the Arabic symbols cannot be represented in a Monospaced Font.
قد يكون هذا مشكلة إذا كان لا يمكن تمثيل الرموز العربية في خط أحادي المسافة.

The Arabic written language is full of ligatures that could pose issues when applied to a Monospaced Font.
تمتلئ اللغة العربية المكتوبة بالأحرف المركبة التي يمكن أن تثير مشاكل عند تطبيقها على خط أحادي المسافة.

Also the Right To Left doesn't help...
كما أن اليمين إلى اليسار لا يساعد ...

ربّما تعني نوع الخط الذي ذكرتُهُ في المشاركة السالفة والذي هو Monospace Regular 12.

google translate:

"Maybe it "you" means the type of font that I mentioned in the previous post which is Monospace Regular 12."

But if the Lazarus TSynEdit is able to display the Arabic, then there's hope, since the editor is also using a Monospaced font.
ولكن إذا كان Lazarus TSynEdit قادرًا على عرض اللغة العربية ، فهناك أمل ، لأن المحرر يستخدم أيضًا خطًا أحادي المسافة.

يبدو أنّ الـ TSynEdit إضافة جيّدة ولكنّني لم أُجرّبها ويبدو أنّها مُتعلّقة بواجهة الإستخدام الرسوميّة وليس ببرامج الـ console.

google translate:

"TSynEdit seems to be a good plugin "addition" but I haven't tried it and it appears to be related to the GUI rather than the console "programs"."

@Pascal111: Can I ask you if you could report back with 2 things?:
هل يمكنني أن أسألك عما إذا كان بإمكانك الإبلاغ عن شيئين؟
  • The font name and size you're using on Lazarus
    اسم الخط وحجمه اللذين تستخدمهما في Lazarus
  • The font name and size that you're using in your console/terminal/command line app.
    اسم الخط وحجمه الذي تستخدمه في تطبيق سطر الأوامر / وحدة التحكم / المحطة / الأوامر.
    You can find it on the Setup or Settings or Configure area.
    يمكنك العثور عليه في منطقة الإعداد أو الإعدادات أو التكوين.

Many thanks !!

Cheers,
Gus


أخبرتكـ أعلاه عن نوع الخط الخاص بالـ Terminal ولكنّني لم أجد أين يُمكن ضبط خيار الخط في بيئة Lazarus.

google translate:

"I told you above about the font type for Terminal, but I couldn't find where to set the font option in the Lazarus environment."


PS: I hope the Google Translate didn't offend Pascal111 with it's interpretation of the English and the technical!!
ملاحظة: آمل ألا تسيء ترجمة Google إلى Pascal111 بتفسيرها للغة الإنجليزية والتقنية !!

لتُترجم من الإنجليزيّة إلى العربيّة فالموضوع أكثر صعوبة من أن تُترجم من العربيّة إلى الإنجليزيّة بسبب التراكيب العربيّة المتنوعة ومُرونة اللغة العربيّة وبالتالي ستكون العبارات المُترجمة من الإنجليزيّة إلى العربيّة عن طريق الإعتماد على google translate مُعجمة ومُفكّكة التراكيب والمنطق وليس لها دلالة أو معنى sense. لا ألومكـ فالعربيّة أصعب لغة يُمكن تعلّمها. لن تحتاج إستخدام ميزة من اليمين إلى اليسار فقط لتضبط النّص العربي بل ستحتاج إلى ميزة "RTL".

google translate:

"To be translated from English to Arabic, the topic is more difficult than to translate from Arabic into English due to the diverse Arabic structures and the flexibility of the Arabic language. Therefore, the phrases translated from English into Arabic by relying on google translate will be lexical "not clear nor understood and not belong to the Arabic language nature", disassembled "in" structures and logic, and have no meaning or meaning "sense". I don't blame you, Arabic is the hardest language to learn. You will not need to use the right-to-left feature only to control the Arabic text, but you will need the "RTL" feature."

engkin

  • Hero Member
  • *****
  • Posts: 2812
Re: Displaying Arabic on Console
« Reply #22 on: May 12, 2021, 06:20:28 pm »
"Monospace Regular" is not a font name according to this Linux Mint fourm post:
https://forums.linuxmint.com/viewtopic.php?t=259621



winni

  • Hero Member
  • *****
  • Posts: 2402
Re: Displaying Arabic on Console
« Reply #23 on: May 12, 2021, 06:56:50 pm »
Hi!

Here is the monospaced Arabic typeface Kawkab:


https://github.com/aiaf/kawkab-mono

Winni

pascal111

  • Sr. Member
  • ****
  • Posts: 282
  • Un trabajo en equipo para programas serias.
Re: Displaying Arabic on Console
« Reply #24 on: May 12, 2021, 08:15:32 pm »
Hi!

Here is the monospaced Arabic typeface Kawkab:


https://github.com/aiaf/kawkab-mono

Winni

Thanks!

pascal111

  • Sr. Member
  • ****
  • Posts: 282
  • Un trabajo en equipo para programas serias.
Re: Displaying Arabic on Console
« Reply #25 on: May 12, 2021, 08:21:06 pm »
"Monospace Regular" is not a font name according to this Linux Mint fourm post:
https://forums.linuxmint.com/viewtopic.php?t=259621

لن تُصدّق!
إكتشفتُ شيئاً ،المُشكلة ليست من الـ Terminal فلقد نصّبت Terminal آخر بعد البحث يُدعّم العربيّة والـ RTL وأظهر الحروف العربيّة لنصٍ كتبته ولكن تنفيذ برنامج الـ Lazarus الذي كتبته في أوّل مشاركةٍ في هذ الموضوع حروفه العربيّة لا تظهر إلا كعلامات إستفهام  ،إذاً المُشكلة ليست من الـ Terminal ،العيب في البرنامج نفسه!

google translate:

"you will not believe!
I discovered something, the problem is not from "in" the terminal, so I installed another terminal after searching that supports Arabic and RTL and showed the Arabic letters for a text I wrote, but the implementation "running" of the Lazarus program that I wrote in the first post on this topic, the Arabic letters only appear as question marks, so the problem is not from "in" the Terminal , The defect in the program itself!"


(https://i.postimg.cc/9r697HjL/Screenshot-at-2021-05-12-20-14-06.png)

engkin

  • Hero Member
  • *****
  • Posts: 2812
Re: Displaying Arabic on Console
« Reply #26 on: May 12, 2021, 09:20:32 pm »
Yes, I agree, your last picture points to a problem in the program itself.

tetrastes

  • Full Member
  • ***
  • Posts: 117
Re: Displaying Arabic on Console
« Reply #27 on: May 12, 2021, 10:24:30 pm »
"you will not believe!
I discovered something, the problem is not from "in" the terminal, so I installed another terminal after searching that supports Arabic and RTL and showed the Arabic letters for a text I wrote, but the implementation "running" of the Lazarus program that I wrote in the first post on this topic, the Arabic letters only appear as question marks, so the problem is not from "in" the Terminal , The defect in the program itself!"


(https://i.postimg.cc/9r697HjL/Screenshot-at-2021-05-12-20-14-06.png)

No, defect is not in program. See attachment, this is the output of your first program.

What is the output of "locale" command on your system? It seems that your locale is not UTF-8.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9332
  • FPC developer.
Re: Displaying Arabic on Console
« Reply #28 on: May 12, 2021, 10:26:41 pm »
Yes, I agree, your last picture points to a problem in the program itself.

As Tetrastes already hints, if the locale is an non unicode locale that supports arabic this might happen.

A possible workaround is adding clocale to the uses clause.

tetrastes

  • Full Member
  • ***
  • Posts: 117
Re: Displaying Arabic on Console
« Reply #29 on: May 12, 2021, 10:57:16 pm »
Very strange. I added
Code: Pascal  [Select][+][-]
  1. {$codepage utf8}
to your first code, and the output was question marks instead of arabic letters.
Is this bug in fpc? (I have 3.2.0 linux x86_64)

 

TinyPortal © 2005-2018