mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 00:22:43 +00:00 
			
		
		
		
	 0b6299849e
			
		
	
	
		0b6299849e
		
	
	
	
	
		
			
			The custom TTF path rasterizer is actually generic enough for it to be used for other fonts. To make this more clear, it now lives on its own in the "Font" directory.
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			482 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			482 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Srimanta Barua <srimanta.barua1@gmail.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Vector.h>
 | |
| #include <LibGfx/Bitmap.h>
 | |
| #include <LibGfx/Path.h>
 | |
| 
 | |
| namespace Gfx {
 | |
| 
 | |
| class PathRasterizer {
 | |
| public:
 | |
|     PathRasterizer(Gfx::IntSize);
 | |
|     void draw_path(Gfx::Path&);
 | |
|     RefPtr<Gfx::Bitmap> accumulate();
 | |
| 
 | |
| private:
 | |
|     void draw_line(Gfx::FloatPoint, Gfx::FloatPoint);
 | |
| 
 | |
|     Gfx::IntSize m_size;
 | |
|     Vector<float> m_data;
 | |
| };
 | |
| 
 | |
| }
 |