<commit_before>Class {
	#name : #BlTextParagraphFixedSpan,
	#superclass : #BlTextParagraphSpan,
	#category : #'Bloc-Text-Text-Mocked'
}

{ #category : #drawing }
BlTextParagraphFixedSpan >> drawOnSpartaCanvas: aSpartaCanvas [
	| theAttributes aTextPainter aFontBuilder aCharacterWidth aCharacterHeight |
	
	theAttributes := self attributes.

	aTextPainter := aSpartaCanvas text.
	aFontBuilder := aSpartaCanvas font.

	theAttributes do: [ :anAttribute |
		anAttribute drawBelowOnSpartaCanvas: aSpartaCanvas with: self.
		anAttribute applyOnSpartaFontBuilder: aFontBuilder with: self.
		anAttribute applyOnSpartaTextPainter: aTextPainter with: self ].

	aTextPainter
		font: aFontBuilder build;
		string: self textRun.

	aCharacterWidth := (self width / self textRunLength) asFloat.
	aCharacterHeight := self height.<commit_msg>do not render fixed span if it is empty<commit_after>Class {
	#name : #BlTextParagraphFixedSpan,
	#superclass : #BlTextParagraphSpan,
	#category : #'Bloc-Text-Text-Mocked'
}

{ #category : #drawing }
BlTextParagraphFixedSpan >> drawOnSpartaCanvas: aSpartaCanvas [
	| theAttributes aTextPainter aFontBuilder aCharacterWidth aCharacterHeight |
	
	self spanLength isZero
		ifTrue: [ ^ self ].
	
	theAttributes := self attributes.

	aTextPainter := aSpartaCanvas text.
	aFontBuilder := aSpartaCanvas font.

	theAttributes do: [ :anAttribute |
		anAttribute drawBelowOnSpartaCanvas: aSpartaCanvas with: self.
		anAttribute applyOnSpartaFontBuilder: aFontBuilder with: self.
		anAttribute applyOnSpartaTextPainter: aTextPainter with: self ].

	aTextPainter
		font: aFontBuilder build;
		string: self textRun.

	aCharacterWidth := (self width / self textRunLength) asFloat.
	aCharacterHeight := self height.
{'fraction_non_alphanumeric': 0.0816917728852839, 'fraction_numerical': 0.0, 'mean_word_length': 5.516981132075472, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4433436', 'n_tokens_mistral': 588, 'n_tokens_neox': 550, 'n_words': 132}