صفحة 1 من 2 12 الأخيرةالأخيرة
النتائج 1 إلى 15 من 28

الموضوع: دالة لكتابة العربي على صور GD

  1. #1
    عضو نشيط
    تاريخ التسجيل
    Aug 2005
    المشاركات
    41

    دالة جديدة ومطورة للكتابة بالعربي على صور GD



    ليسمح لي أخي مازن ببعض التطفل، ولكن حبيت اقدم كود جديد للكتابة باللغة العربية على صور الـ GD في PHP.

    ففي التصميم الجديد، يمكن عمل الآتي:
    - استخدام أي خطوط عربية قياسية في بيئة ويندوز أو غيرها
    - لا قلق من ظهور الحروف بطريقة غير صحيحة، لأن الكائن يعتمد مقياس Unicode
    - امكانية الكتابة بالعربية والإنجليزية معاً في سطر واحد
    - إمكانية كتابة الأرقام والاختيار ما بين الشكل العربي والهندي
    - إمكانية اضافة التشكيل على الحروف
    - الكود الآن على شكل دالة لسهولة تضمينها في البرامج

    وهذا مثال للصور المنتجة بالدالة الجديد: http://www.4thtech.com/agd/myArabicGD.php

    وسلامتكم









  2. SO?.... I think you missed something, this Forum is for people to learn something not to declare who is better than who... so please if your trying to show off don’t, but if your planning to shear your code please do, so we can call you a good contributor .. not only that we might give you some respect also.

    Sallam





    __________________
    هلابي افضل المواقع العربية تصميماً
    انصح باستخدام ابونتو

  3. #3
    عضو نشيط
    تاريخ التسجيل
    Aug 2005
    المشاركات
    41


    You could have simply asked for the source code without giving lesson on contribution ethics! I don't know how you got the impression that my intention was to show whose solution was better! I only and faithfully submitted this to help Muslims programmers. So, when I release the source code, I won't ask you to call me "a good contributor". Instead, I'll ask Allah to forgive my sins.

    Salaam.







  4. #4
    عضو نشيط
    تاريخ التسجيل
    Aug 2005
    المشاركات
    41


    الكود المصدري موجود على الرابط التالي: http://www.4thtech.com/agd/myArabicGD.php.txt

    كان بودي طرحه بعد أخذ بعض الآراء من الأعضاء الأكارم. وذلك إن كان يحتاج بعض الإضافات أو نحوه. ولكن يبدو أن البعض لا تعجبهم هذه الطريقة. فلهم اتقدم بالعذر.








  5. Thanks for understanding, come on man you’re a programmer and I’m a programmer, we both don’t care about the output as much as the efficiency of the code and the algorithms inside.

    You gave a lot of time in this code I can see that it took you some time for you to encode all these to UTF-8.

    Do you mind we talk like programmers now?
    I might try to use a for loop to generate the arrays, and I will try to compare the times it takes to make the arrays your way or the for loop way though I think it would be faster in your way.

    Another thing I would like you to take a note of one thing your server has a native language as English, why don’t you make it UTF-8 by changing:

    AddDefaultCharset iso-8859-1 - to this - AddDefaultCharset UTF-8
    in the your httpd.conf file

    And anyway .. nice algo





    __________________
    هلابي افضل المواقع العربية تصميماً
    انصح باستخدام ابونتو

  6. #6
    عضو نشيط
    تاريخ التسجيل
    Aug 2005
    المشاركات
    41


    Ok, no problem. Programmer's first role is to ensure output coherency with requirements using the best possible code

    Yes, using an array is faster than generating the codes in a loop. Even though, I'd love to see how you can generate the uni-codes using a loop!

    Finally, I always try to keep the setting as close as to the default values to ensure compatibility

    .Take care









  7. Oh, compatibility! Hmmm that’s something I totally forgot about, thanks for refreshing my views, I will try to find a common ground on how would I generate the array with a loop, give me some time to try that, my next post will be either with a for loop solution or with a sorry “ it seems that my for loop can’t work :P “





    __________________
    هلابي افضل المواقع العربية تصميماً
    انصح باستخدام ابونتو



  8. The time now is 12am in Malaysia – I’m working so I need to sleep – but I will continue doing it later, I will conceder this as my mini project, though the function might be really slow, I hope I can make a totally non characterized function so any computer with even no Arabic capabilities to produce the picture, I would like you to help me out also.. Though it might be one of our useless functions ever but come on servers nowadays could do this in less than 1 second not to mention that PHP is that fast... Anyway this is what I have so far.

    كود PHP:
    <?    
        $if_not_doubles 
    = array(1,2,3,4,6,8,14,15,16,17,33,34,36,37,38,39);
        
    $letters_in_arabic = array ('Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï',
                                    
    'Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ý','Þ','ß',
                                    
    'á','ã','ä','å','æ','ì','í','ÂÂ','ÃÃ','ÅÅ','ÇÇ');
        
    $start_number '65153';
        
        function 
    doubles($start_number){
                
    $pluse $start_number;
                
    $temp = array($start_number,++$pluse,$start_number,$pluse);
                
    $start_number = ++$pluse;
                return 
    $temp;
        }
        
        function 
    normal($start_number){
                
    $temp = array($start_number,++$start_number,++$start_number,++$start_number);
                ++
    $start_number;
                return 
    $temp;
        }
        
    $y 0;
        
    $count 1;
        
    //$count2 = 0;
        
    $temp = array();
        
        while(
    each($letters_in_arabic)){
                if(
    $if_not_doubles[$y] <> $count++) {
                    
    array_push$tempnormal(&$start_number) ); 
                    }
                else { 
                
    array_push$tempdoubles(&$start_number)); $y++; 
                }
        }
        
    print_r($temp);
        
    ?>
    what do you think ?






    __________________
    هلابي افضل المواقع العربية تصميماً
    انصح باستخدام ابونتو

  9. #9
    عضو نشيط جدا
    تاريخ التسجيل
    Aug 2004
    المشاركات
    361


    ما شاء الله عليك والله يا أخى أحسنت وأعجبنى كثير


    تقدم للأمام ولاتنظر خلفك


    وفقنا الله واياك أخى الكريم





    __________________
    أستغفر الله :: أستغفر الله :: أستغفر الله ::
    لا إله إلا أنت سبحانك أستغفرك وأتوب إليك إنى كنت من الظالمين

    phparabia @ msn.com

  10. #10
    عضو نشيط
    تاريخ التسجيل
    Jan 2005
    المشاركات
    285


    جميل جد

    وفقك الله





    __________________
    "من علمني حرفا صرت له عبدا"
    |+|PHP|+|loowy|+|PHP|+|
    "عامل الناس بما تحب أن يعاملوك به"
    لـــــــــــــــــــــــــــــؤي

  11. #11
    عضو نشيط
    تاريخ التسجيل
    Aug 2005
    المشاركات
    41


    الله يوفق الجميع لما يحبه ويرضاه بمنه وكرمه. وان شاء الله تكون الدالة الجديدة مفيدة للجميع.

    اقتباس المشاركة الأصلية كتبت بواسطة hilaby
    the function might be really slow, I hope I can make a totally non characterized function so any computer with even no Arabic capabilities to produce the picture
    Well, you can try using a loop to generate the codes. But I think having them hard-coded is better. The function I came up with does not need an Arabic-enabled OS to work though









  12. Common man! Motivate me, not putting me down, but anyway I believe that what ever I’m doing is not adding to the function of yours anything at all. So from this I have learnt my lesson, which is “don’t try to prove something as not efficient where it is obviously the best solution to the problem”. Thanks man!
    =========
    Anyway what could be done on the GD2 library could be done also on the Ming library, what do you think? Should this be sued to generate flash as well?






    __________________
    هلابي افضل المواقع العربية تصميماً
    انصح باستخدام ابونتو

  13. #13
    عضو نشيط جدا
    تاريخ التسجيل
    Feb 2003
    المشاركات
    537


    السلام عليكم اخي الكريم backup4arab.com شكرا لك والله داله جدا مميزها والله لا يحرمك و يوفقك .






  14. #14
    عضو نشيط جدا
    تاريخ التسجيل
    Feb 2003
    المشاركات
    537


    أخي الكريم backup4arab.com تعرف جربته و سويه بيها كم تجربه ولكن مع الاسف يوجد مشكله ان شاء الله تحاول تسويه في التطوير القادم اذا وجود و هي انه تقدر تسنخدم خطوط في مجلد معين على السرفر و هي دعم FreeType Support لان الداله الخاص بيك تستخدم الخطوط من نفس الونيدوز و هنا سوف تكون مشكله لا يمكن اضافة خطوط عربيه اكثرمن الموجوده في الونيدوز .


    تحياتي و مشكور من جديد






  15. #15
    عضو نشيط
    تاريخ التسجيل
    Aug 2005
    المشاركات
    41


    اقتباس المشاركة الأصلية كتبت بواسطة 4arab.net
    ولكن مع الاسف يوجد مشكله ان شاء الله تحاول تسويه في التطوير القادم اذا وجود و هي انه تقدر تسنخدم خطوط في مجلد معين على السرفر و هي دعم FreeType Support لان الداله الخاص بيك تستخدم الخطوط من نفس الونيدوز و هنا سوف تكون مشكله لا يمكن اضافة خطوط عربيه اكثرمن الموجوده في الونيدوز .
    إن المثال الموجود في الموضوع الأصلي أعلاه يعمل على سيرفر لاينكس وهو يستخدم خطوط TTF موجودة في نفس المجلد. أي أنك تستطيع استخدام خطوط لا علاقة لها بالويندوز. قد تكون استخدمت خطوطاً غير قياسية (أي لا تستخدم ترميز Unicode العربي) مما سبب عدم ظهور الحروف العربية بشكلها الصحيح.










ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا|شقق للايجار في الكويت | بيوت للبيع في الكويت | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض