Giter VIP home page Giter VIP logo

persian-log2vis's Introduction

Persian Log2Vis version 2

Persian Log2Vis is a library to convert all Arabic-based languages (eg. Persian/Farsi, Arabic, Dari, Pashto, Panjabi, Urdu and ...) texts to image.

persian-log2vis's People

Contributors

itsjw avatar mtvs avatar omid avatar tahmasebi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

persian-log2vis's Issues

English sentences go reverse by words

thank for your nice work.
English sentences go reverse by words. for example:
"سلام حال شما؟ : Hello how are you?"
print like this:
"سلام حال شما؟ : ?you are how Hello"

what can i do for this?

Not working properly with some words

I've used it and it's working way better then ar-php and other libraries over the internet but this too is messing with some characters to be printed on the image,

I'm using this in LARAVEL following is my code

	public function createVGImage(Request $data)
	{
		$dateIslamic = $data->islamic_calender;
		$dateEnglish = $data->date_recorded;
		$city = $data->cityName;
		$place = $data->placeName;
		$nameOfImg = $this->generalService->generateRandomString();
		$nameOfImg = $nameOfImg.'.png';
		
//		$text = ' 5 ربیع الاول 1439';
		$text = $dateIslamic;
		persian_log2vis($text);
		
//		$text1 = '24 December 2017';
		$text1 = $dateEnglish;
		persian_log2vis($text1);
		
//		$text2 = 'ملتان پاکستان';
		$text2 = $place.' '.$city;
		persian_log2vis($text2);
		
		if($data->group_type == 1) {
			// Create the image
			$im = imagecreatefromjpeg(public_path() . '/assets/client/images/sample1.jpg');
		} else {
			$im = imagecreatefromjpeg(public_path() . '/assets/client/images/sample2.jpg');
		}
		// Create some colors
		$white = imagecolorallocate($im, 255, 255, 255);
		$yellow = imagecolorallocate($im, 248, 255, 0);
		$bg_color = imagecolorallocate($im, 255, 255, 255);
		
		// Replace path by your own font path
		$font = public_path().('/assets/client/p21/DejaVuSans.ttf');
		
		// Add the text
		@imagettftext($im, 100, 0, 140, 600, $white, $font, $text);
		@imagettftext($im,  50, 0, 350, 800,  $white, $font, $text1);
		@imagettftext($im,  100, 0, 300, 1050,  $yellow, $font, $text2);
		
		// Set the content-type
//		header("Content-type: image/png");
		
		// Using imagepng() results in clearer text compared with imagejpeg()
		imagepng($im, "uploads/".$nameOfImg);
		imagedestroy($im);

		return collect([
			'collect' => 'success',
			'name' => $nameOfImg
		]);
		
	}

And it messing on hey, the words crashing is

جہلم

Please look into it, or may be suggest me some solution to get this done as well.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.